Skip to content

Instantly share code, notes, and snippets.

@mrseanryan
Created January 19, 2024 15:25
Show Gist options
  • Save mrseanryan/a7d8ed4bfda2f3f6e495bfe719e8d35c to your computer and use it in GitHub Desktop.
Save mrseanryan/a7d8ed4bfda2f3f6e495bfe719e8d35c to your computer and use it in GitHub Desktop.
Bash script to lint Python code via flake8 - shows how to disable rules.
# so future errors halt the script.
set -e
echo Linting ...
# Disable less useful errors
# - ref https://www.flake8rules.com/
#
# E302 Expected 2 blank lines
# E305 Expected 2 blank lines after end of function or class
# E501 Line too long (82 > 79 characters)
FLAKE8_TO_IGNORE=E302,E305,E501
python -m flake8 --extend-ignore $FLAKE8_TO_IGNORE ../src
echo [done]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment