[Python-projects] pylint: Locally disabling R0801
Rasener, Dustin M
Dustin.M.Rasener at pearson.com
Tue Dec 30 16:22:09 CET 2008
Maarten wrote:
> On Thursday 18 December 2008, Rasener, Dustin M wrote:
>
> > I have tried to locally disable message R0801 (similar lines in X
> > files), with no success.
> >
> > I have tried placing this line in __init__() for the package; I have
> > also tried placing it above the offending (similar) lines.
> >
> > # pylint: disable-msg=R0801
> >
> > Can anyone help me to get this message locally disabled?
>
> How local is "locally"? For one module (source file)? For one project?
>
> Disabling the message for a project is possibly by making a "pylintrc"
> file:
> pylint --generate-rcfile > pylintrc
> Then in the "pylintrc" file, look for the "disable-msg=" line and add
> "R0801" there.
>
> Bye,
> Maarten
Thank you for your reply, Maarten. I would like to disable this message
in the same way that I locally disable other messages in pylint. For
example, if I want to not include a docstring for just one function in a
file, I would use:
# pylint: disable-msg=C0111
def function_with_no_docstring(self):
...
My main problem is that the "similar lines" checker (R0801 above)
catches similar import statements in different files. I would like to
get these messages where they are useful (where there is a possibility
to refactor copy-and-pasted code), so I don't want to disable it
completely. However, I cannot seem to accomplish with R0801 what I have
with other messages. (locally disabling the message for particular lines
of code.)
Thanks again for your reply, and thanks for any help.
Dustin
More information about the Python-Projects
mailing list