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

Fix black error #168

Merged
merged 11 commits into from
May 24, 2021
22 changes: 10 additions & 12 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@ jobs:
python -m pip install --upgrade pip
pip install black flake8 mypy
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Format check with Black
run: black --check src tests
- name: If needed, commit black changes to the pull request
if: failure()
run: |
black src tests
git config --global user.name 'autoblack'
git config --global user.email 'martomi@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git checkout $GITHUB_HEAD_REF
git commit -am "fixup: Format Python code with Black"
git push
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand All @@ -51,3 +39,13 @@ jobs:
- name: Unit Tests
run: |
python -m unittest
- name: Format check with Black
run: |
git config --global user.name 'autoblack'
git config --global user.email 'martomi@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git fetch
git checkout $GITHUB_HEAD_REF
black src tests
git commit -am "fixup: Format Python code with Black"
git push