Using Flake8 for Style Checks
What Flake8 checks
- style (PEP8-ish)
- unused imports
- simple logical issues
Run
bash
flake8 .bash
flake8 .Example configuration
In .flake8.flake8:
ini
[flake8]
max-line-length = 88
extend-ignore = E203,W503
exclude = .git,__pycache__,.venv,build,distini
[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
