Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check autoformat #7

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions .github/workflows/lint-format-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
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
Expand All @@ -58,8 +71,22 @@ 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: |
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
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 "[email protected]"
git config --global user.name "GitHub Actions"
git add .
git commit -am "Automated Backend Formatting Fixes"
# git push
8 changes: 2 additions & 6 deletions backend/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]",
},
contact=[{"name": "Kayvan Shah",# "url": "Contact URL 1",
"email": "[email protected]", },
{
"name": "Bhumi Godiwala",
# "url": "Contact URL 2",
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/", {
Expand Down