Skip to content

Commit

Permalink
Update github actions, add prettier, format frontend on pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
CLeopard99 authored Oct 22, 2024
1 parent 626f093 commit 2727ade
Show file tree
Hide file tree
Showing 31 changed files with 1,323 additions and 308 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/lint-backend.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Lint Backend
on:
pull_request:
push:
branches:
- main

jobs:
linting:
Expand All @@ -14,6 +17,6 @@ jobs:
uses: actions/setup-python@v2

- name: Lint
uses: chartboost/ruff-action@v1
uses: astral-sh/ruff-action@v1
with:
src: ./backend
10 changes: 7 additions & 3 deletions .github/workflows/lint-frontend.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Lint Frontend

on:
on:
pull_request:
push:
branches:
- main

jobs:
linting:
Expand All @@ -23,4 +25,6 @@ jobs:
run: npm install

- name: Lint
run: npm run lint
run: |
npm run lint
npx prettier . --check
3 changes: 3 additions & 0 deletions .github/workflows/test-backend.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test Backend
on:
pull_request:
push:
branches:
- main

jobs:
testing:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/type-check-backend.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Type Check Backend
on:
on:
pull_request:
push:
branches:
- main

jobs:
checking:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ poetry.toml
# ruff
.ruff_cache/

# npm
node_modules/

# IDE stuff
.vscode
/.idea/material_theme_project_new.xml
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cd frontend
npx lint-staged
76 changes: 35 additions & 41 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended"
],
"overrides": [
{
"env": {
"node": true
},
"files": [".eslintrc.{js,cjs}"],
"parserOptions": {
"sourceType": "script"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "react", "@stylistic/js"],
"rules": {
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"@stylistic/js/eol-last": ["error", "always"]
},
"settings": {
"react": {
"version": "detect"
}
}
}
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended"
],
"overrides": [
{
"env": {
"node": true
},
"files": [".eslintrc.{js,cjs}"],
"parserOptions": {
"sourceType": "script"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "react", "@stylistic/js"],
"settings": {
"react": {
"version": "detect"
}
},
"ignorePatterns": ["**/*.css"]
}
3 changes: 3 additions & 0 deletions frontend/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
1 change: 1 addition & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ UI service for interfacing with InferGPT.
1. Ensure the `.env` file has been configured as described in the main [README](../README.md).

This README covers instructions on how to run the application:

- Locally
- In a Docker Container

Expand Down
Loading

0 comments on commit 2727ade

Please sign in to comment.