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

Simplify black check #188

Merged
merged 1 commit into from
May 25, 2021
Merged
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
18 changes: 2 additions & 16 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ 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: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand All @@ -39,19 +41,3 @@ jobs:
- name: Unit Tests
run: |
python -m unittest
- name: Format check with Black
run: |
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
- 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 upon black check
if: steps.git-check.outputs.modified == 'true'
run: |
git config --global user.name 'autoblack'
git config --global user.email 'martomi@users.noreply.github.com'
git commit -am "fixup: Format Python code with Black"
git push