Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What pylint options can be specified in inline comments?

Tags:

python

pylint

I note that I can disable particular messages using a comment. For example, pylint by default complains about variable names of less than three letters. I can suppress that like this:

# pylint: disable=invalid-name
def some_string_operation(s):  # (the same thing here would also work)
    return something(s)

But I cannot, for example, add s to the good-names list. This doesn't work:

# pylint: good-names=s
def some_string_operation(s):
    return something(s)

So clearly not all options can be modified that way. Which ones can?

like image 969
Andrew Avatar asked Jan 15 '16 02:01

Andrew


1 Answers

In the module comments you can only enable/disable specific PyLint checks:

# pylint: disable=wildcard-import, method-hidden
# pylint: enable=too-many-lines
like image 58
alecxe Avatar answered Oct 04 '22 04:10

alecxe