Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quieting pylint false-positives when using django

I'd like to sanely quiet a few pylint errors when using Django. The two that are causing the greatest irritation are when deriving from django.db.models.Model and accessing objects, and django.test.TestCase. In the first, pylint complains about any code that uses the attribute 'objects', saying it isn't a member. In the second, after adding seven tests to a test case, it complains about too many public methods (I'm guessing that TestCase has fourteen)

I know the first part of this is a duplicate of question 115977, but that question is a little old and none of the solutions are very good so I thought I'd poke the issue.

I don't want to simply suppress the complaints in pylint, as I like to see them in other circumstances.

like image 348
JivanAmara Avatar asked Aug 10 '10 09:08

JivanAmara


1 Answers

if you do not care some pylint's warnings, like unexistent member(E1101) and too many public methods(R0904), you can easily close it with:

pylint --disable=E1101,R0904

if you are interested with few checkers only, you can run pylint like this:

pylint --enable=basic,variables,classes,design,imports,newstyle,exceptions,format,miscellaneous,metrics,similarities
like image 75
Xie Yanbo Avatar answered Sep 28 '22 21:09

Xie Yanbo