From 9c29c992c728b1e2d760d7b6dc84bcb7507f7c1f Mon Sep 17 00:00:00 2001 From: Bhumi Godiwala Date: Mon, 4 Sep 2023 21:43:58 -0500 Subject: [PATCH 1/3] Check autoformat --- .github/workflows/lint-format-checks.yml | 28 +++++++++++++++++++++++- backend/app/main.py | 8 ++----- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lint-format-checks.yml b/.github/workflows/lint-format-checks.yml index 65b9615..967c548 100644 --- a/.github/workflows/lint-format-checks.yml +++ b/.github/workflows/lint-format-checks.yml @@ -31,9 +31,22 @@ jobs: run: npm run lint - name: Format with Prettier - run: npm run format:check + run: npm run format continue-on-error: true + - name: Check for modified files + id: git-check + run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) + + - name: Push changes + if: steps.git-check.outputs.modified == 'true' + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git add . + git commit -am "Automated Frontend Formatting Fixes" + # git push + lint-format-backend: name: Lint and Format Backend runs-on: ubuntu-latest @@ -63,3 +76,16 @@ jobs: run: | find . -name "*.py" -print0 | xargs -0 black --check --experimental-string-processing --line-length=120 continue-on-error: true + + - name: Check for modified files + id: git-check + run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) + + - name: Push changes + if: steps.git-check.outputs.modified == 'true' + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git add . + git commit -am "Automated Backend Formatting Fixes" + # git push \ No newline at end of file diff --git a/backend/app/main.py b/backend/app/main.py index 58d4b6a..be331db 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -16,12 +16,8 @@ description=settings.description, version="1.0.0", # terms_of_service="URL to terms of service", - contact=[ - { - "name": "Kayvan Shah", - # "url": "Contact URL 1", - "email": "kayvan.shah@usc.edu", - }, + contact=[{"name": "Kayvan Shah",# "url": "Contact URL 1", + "email": "kayvan.shah@usc.edu", }, { "name": "Bhumi Godiwala", # "url": "Contact URL 2", From 179470c023d96fdb786a619d4f2d5e6e8a81a6b6 Mon Sep 17 00:00:00 2001 From: Bhumi Godiwala Date: Mon, 4 Sep 2023 21:50:40 -0500 Subject: [PATCH 2/3] updated backend autoformat --- .github/workflows/lint-format-checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint-format-checks.yml b/.github/workflows/lint-format-checks.yml index 967c548..5daa66f 100644 --- a/.github/workflows/lint-format-checks.yml +++ b/.github/workflows/lint-format-checks.yml @@ -71,6 +71,7 @@ jobs: - name: Lint with Flake8 run: | find . -name "*.py" -print0 | xargs -0 flake8 --max-line-length=120 --ignore=E402,F841,F401,E302,E305,E266,E203,W503 + continue-on-error: true - name: Format with Black run: | From dfa858170f35d9deca628a72cc58fa789dfac819 Mon Sep 17 00:00:00 2001 From: Bhumi Godiwala Date: Mon, 4 Sep 2023 22:00:17 -0500 Subject: [PATCH 3/3] update check --- .github/workflows/lint-format-checks.yml | 2 +- frontend/src/App.js | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint-format-checks.yml b/.github/workflows/lint-format-checks.yml index 5daa66f..a1db9aa 100644 --- a/.github/workflows/lint-format-checks.yml +++ b/.github/workflows/lint-format-checks.yml @@ -75,7 +75,7 @@ jobs: - name: Format with Black run: | - find . -name "*.py" -print0 | xargs -0 black --check --experimental-string-processing --line-length=120 + find . -name "*.py" -print0 | xargs -0 black --experimental-string-processing --line-length=120 continue-on-error: true - name: Check for modified files diff --git a/frontend/src/App.js b/frontend/src/App.js index 1b90d06..ddb85b3 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -11,10 +11,7 @@ export default function App() { useAutosizeTextArea(textAreaRef.current, emailPrompt); - const handleChange = (evt) => { - const val = evt.target?.value; - setEmailPrompt(val); - }; + const handleChange = (evt) => {const val = evt.target?.value;setEmailPrompt(val);}; const getEmailResponse = async (text) => { var email_response = await fetch("http://127.0.0.1:8000/emails/", {