Pylint: “Locally defined bans” still give warnings. How to suppress them?

I work with a software infrastructure that has a couple of classes with method names containing capital letters (due to C ++ wrappers). This, of course, is not PEP8, but pylint shows the corresponding error C0103 . I also added C0111 to the list to ignore missing docstrings for some methods, for example:

 def Configure(self): # pylint: disable=C0103,C0111 

This works, however now I get warnings due to local outages:

 Class: I0011 -> locally disabling C0103 Class: I0011 -> locally disabling C0111 

How can I crush them?

+7
pylint
source share
1 answer

OK, so it’s obvious that you need to explicitly ignore the warning — ignore it. This can be done in the pylint configuration file: if you don’t have one, just create a standard configuration via

 pylint --generate-rcfile > pylint.rc 

and uncomment the line with disable=... and add I0011 to the list. This suppresses all warnings regarding "locally defined violations."

Another method is to add the following line to the beginning of the file (or block, whatever) if you do not want to suppress the warning globally:

 #pylint: disable=I0011 
+10
source share

All Articles