Skip to content

Commit

Permalink
PR-check: require clean flake8, add no findings notes
Browse files Browse the repository at this point in the history
We have a clean flake8 status now, so let's not check if more
was injected - just fail if any are found.
  • Loading branch information
JanneKiiskila committed Oct 20, 2023
1 parent 1ffec0e commit 9fe0ae5
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/pr-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
echo "Misspell has findings, fail."
echo "TEST_FAIL=true" >> $GITHUB_ENV
exit 1
else
echo "No findings."
fi
- name: Run pylint (findings may not increase)
Expand All @@ -58,23 +60,22 @@ jobs:
echo "TEST_FAIL=true" >> $GITHUB_ENV
exit 1
fi
- name: Run flake8 (findings may not increase)
- name: Run flake8
if: always()
run: |
sudo apt-get install flake8
flake8 --version
echo "Starting flake8..."
flake8 --exit-zero --exclude=izuma_systest_lib/.eggs,scripts-internal --max-line-length=130 >flake8.log
echo "### flake8" >>$SUMMARY_FILE
flakestats=$(scripts-internal/ci/more-lines-checker.sh ${{ github.event.repository.default_branch }} ${{ github.ref_name }} \
"flake8 --exit-zero --exclude=systemtest-library/.eggs,scripts-internal --max-line-length=130" | tail -n2)
echo "$flakestats" >>$SUMMARY_FILE
echo "$flakestats"
if [[ $flakestats == *"Oh no"* ]]; then
# More findings than earlier
lines=$(wc -l < "flake8.log")
if [[ $lines -gt 0 ]]; then
echo "Flake8 has findings, fail."
echo "TEST_FAIL=true" >> $GITHUB_ENV
exit 1
fi
else
echo "No findings."
fi
- name: Archive production artifacts
if: always()
Expand Down

0 comments on commit 9fe0ae5

Please sign in to comment.