Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can pylint msg "too many local variables" be disabled

I am working on eclipse editor and using eclipse plugin pydev. I have also installed pylint plugin. But pylint is throwing me warning messages in some functions like "too many local arguments". I don't want to change my code. Is there any way to disable those warnings, especially this one. I do have a ~/.pylintrc file. What should I add to that file to disable these warning messages.

like image 900
Kamal Pandey Avatar asked May 08 '18 08:05

Kamal Pandey


2 Answers

you can modify the max-locals for local variable and max-args for method arguments in .pylintrc file

[DESIGN]

# Maximum number of locals for function / method body
max-locals=25

# Maximum number of arguments for function / method
max-args=10

from : source

like image 140
Roushan Avatar answered Nov 17 '22 09:11

Roushan


If you need to skip pylint validation for some specific function then add the line (comment)

# pylint: disable-msg=too-many-locals

inside that function. You may add this line right after the function declaration.

like image 43
Andriy Avatar answered Nov 17 '22 11:11

Andriy