Mridang Agarwalla
Mridang Agarwalla

Reputation: 44988

Disabling some messages when using Pylint in Django

I'm using the django-jenkins plugin in my Django project and it seems that it has installed pylint. I can run pylint byt running python manage.py pylint. It works just fine but I would like to disable some messages e.g. w0614. I can't seem to pass this as parameter to pylint using the manage.py. Could anyone of you tell me how I can quiet those W0614 messages?

Thanks.

Upvotes: 1

Views: 2384

Answers (3)

Evert
Evert

Reputation: 51

In newer versions of pylint, the disable-msg has been replaced with 'disable', so the comment should be:

# pylint: disable=W0614

Or from the command line it would be:

--disable=W0614

Check the Messages Control or Command line options sections of the manual for more details.

Upvotes: 5

kmmbvnr
kmmbvnr

Reputation: 6139

You could set the PYLINT_RCFILE to full path to custom pylintrc file or just place pylint.rc in root of your project

Check the default_config_path method code: https://github.com/kmmbvnr/django-jenkins/blob/master/django_jenkins/tasks/run_pylint.py

Upvotes: 4

Alasdair
Alasdair

Reputation: 308849

You can disable a warning by adding a comment to each python file where the warning is raised.

# pylint: disable-msg=w0614

If you don't want to add the comment to each python file, see the question How do I disable a PyLint warning? for a global solution.

Upvotes: 3

Related Questions