Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pycodestyle: Ignore directives project-wise

Is there a way to configure a python project to ignore specific pycodestyle directives project-wise?

i.e. adding a file in the likes of say .pycodeignore in the project's root with entries like:

E302
E266

etc?

like image 426
pkaramol Avatar asked Nov 26 '25 18:11

pkaramol


2 Answers

According to the configuration docs, you can create a file called setup.cfg or tox.ini in the root of your project and write the following:

[pycodestyle]
ignore = E226,E302
like image 185
devaerial Avatar answered Nov 29 '25 08:11

devaerial


As per the pycodestyle documentation

[pycodestyle]
count = False
ignore = E226,E302,E41
max-line-length = 160
statistics = True

At the project level, a setup.cfg file or a tox.ini file is read if present. If none of these files have a [pycodestyle] section, no project specific configuration is loaded.

like image 37
Abdul Niyas P M Avatar answered Nov 29 '25 08:11

Abdul Niyas P M



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!