1

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.

Denis Otkidach
  • 32,032
  • 8
  • 79
  • 100
Mridang Agarwalla
  • 43,201
  • 71
  • 221
  • 382

3 Answers3

5

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.

istruble
  • 13,363
  • 2
  • 47
  • 52
Evert
  • 51
  • 1
  • 2
4

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

kmmbvnr
  • 5,863
  • 4
  • 35
  • 44
3

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.

Community
  • 1
  • 1
Alasdair
  • 298,606
  • 55
  • 578
  • 516
  • I added this it __init_.py file in the module but I still get those messages. I also try adding them to the manage.py file but to no avail. Do I need to put this in each file where these errors are reported? – Mridang Agarwalla Oct 24 '11 at 13:29
  • 1
    Yes, I think you need to add the comment to each file where the warning is reported. That's not ideal -- it might take as long as it would to fix the unused imports! For a global solution, have a look at http://stackoverflow.com/questions/4341746/how-do-i-disable-a-pylint-warning – Alasdair Oct 24 '11 at 13:36
  • That rcfile did it. Cheers Alasdair. – Mridang Agarwalla Oct 24 '11 at 14:00
  • Great! I've edited the answer to make the link to the other question more obvious. – Alasdair Oct 24 '11 at 14:17