Using Flake8 for Style Checks
What Flake8 checks
- style (PEP8-ish)
- unused imports
- simple logical issues
Run
flake8 .flake8 .Example configuration
In .flake8.flake8:
[flake8]
max-line-length = 88
extend-ignore = E203,W503
exclude = .git,__pycache__,.venv,build,dist[flake8]
max-line-length = 88
extend-ignore = E203,W503
exclude = .git,__pycache__,.venv,build,distPlugins (popular)
flake8-bugbearflake8-bugbearflake8-comprehensionsflake8-comprehensionsflake8-docstringsflake8-docstrings
Tip
If you use Black, align flake8 ignores with Black defaults.
๐งช Try It Yourself
Exercise 1 โ Write a unittest TestCase
Exercise 2 โ assertRaises
Exercise 3 โ setUp and tearDown
If this helped you, consider buying me a coffee โ
Buy me a coffeeWas this page helpful?
Let us know how we did
