logo

... flake8.


While your program may work functionally, it may still be hard to maintain if the style of it is messy. So it would be nice to automated code style. A favourable tool for that the flake8 ecosystem.


Notes

Instead of passing everything on the command line you may also choose to have a config file. This is what our .flake8 file looks like;

[flake8]
# W291 - we dont care about trailing whitespace
# E302 - one line between functions is fine
ignore = W291,E302
exclude = ignore_this.py

The ignore_this.py file merely contains an import statement that is not used.

import pandas as pd

This is not a good python file to have lying around but it does demonstrate how flake8 can be configured to ignore certain files.


Feedback? See an issue? Something unclear? Feel free to mention it here.

If you want to be kept up to date, consider getting the newsletter.