Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pylint: ignore multiple in rcfile

Tags:

python

pylint

In my django project I'm using an externally written app which is badly written. Now I want to ignore this app from my pylint reporting, however I can't get pylint to ignore it. Pylint is already ignoring the South migrations, like this:

[MASTER]
ignore=migrations

However, the documentation states that multiple ignores can be specified. But I've tried a few and couldn't get them to work.

Doesn't work:

[MASTER]
ignore=migrations,badapp

Also doesn't work:

[MASTER]
ignore=migrations
ignore=badapp

My project structure is like this:

|-- goodapp
|    |-- models.py
|    |-- tests.py
|    +-- views.py
|-- badapp
|    |-- models.py
|    |-- tests.py
|    +-- views.py
|-- manage.py

I'd rather not sprinkle my code with # pylint: skip-file, but rather configure pylint using the rcfile.

like image 430
Bouke Avatar asked May 15 '13 08:05

Bouke


2 Answers

ignore can be set multiple times when given as a command line option, eg

pylint --ignore=migrations --ignore=badapp mymodule.py

But not in the configuration file (see the ConfigParser documentation). Though

[MASTER]
ignore=migrations,badapp

should work, if not that should be reported as a bug.

like image 73
sthenault Avatar answered Nov 15 '22 01:11

sthenault


You can do --ignore=migrations,badapp but not for example --ignore=lib/migrations,apps/badapp - pylint does not understand full paths, only basenames. Also in my version it ignores all multipe instances of --ignore in the command line using only the last --ignore parameter.

like image 2
max Avatar answered Nov 15 '22 01:11

max