[code-quality] Pylint: Disable specific warnings for modules in a specific folder

Florian Bruhin me at the-compiler.org
Wed Mar 23 17:16:09 EDT 2016


Hey!

* Edward Ekelund <edward.ekelund at axis.com> [2016-03-23 17:09:51 +0000]:
> I would like to disable a set of warnings for modules in a specific 
> folder. Is this possible somehow?
> 
> If not, can this feature be added?

There's an open issue for it since a while:
https://github.com/PyCQA/pylint/issues/618

There was some work on it, but the person who started working on it
unfortunately never submitted a pull request :(

> More specifically, we have a folder in our project which contains many 
> function/unit test modules. Some Pylint-warnings, e.g., `invalid-name` 
> and `protected-access` are not helpful in that context, and we would 
> like to be able to disable those checks for all modules in that directory.
> 
> Also, we would like to avoid adding #-disable boilerplate inside every 
> single file; preferably we would like to add the folder-specific 
> disables in the project's pylintrc-file.

Personally I use a script to find my test files (as they don't have
__init__.py files because I'm using py.test). That script also adds
some disables:

https://github.com/The-Compiler/qutebrowser/blob/master/scripts/dev/run_pylint_on_tests.py

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/code-quality/attachments/20160323/5baef660/attachment.sig>


More information about the code-quality mailing list