Questions tagged [pylint]

Pylint is a Python source code analyzer looking for bugs and signs of poor quality.

Pylint is a Python tool that checks if a module satisfies a coding standard.

1691 questions
16
votes
1 answer

pylint complain if we use pandas class instances

pylint complain about pandas class instances:: I have db instance that has data (a panda Dataframe) as instance. If I call e.g. iloc or shape on it:: cols = db.data.shape xxx = db.data.iloc[1:4, 0:9] pylint complain about:: E: 36,18: Instance of…
user3313834
  • 7,327
  • 12
  • 56
  • 99
16
votes
2 answers

Force string format in pylint

Python allows to use either single or double quotes for strings. I'd like to enforce only single quotes format in my projects. Is there any specific rule in pylint or an existing pylint plugin to achieve that?
pablomolnar
  • 528
  • 6
  • 14
16
votes
1 answer

Pylint warning: Possible unbalanced tuple unpacking with sequence

I have a piece of Python code: def func1(): a=set() b = ','.join(map(str, list(a))) return b, [] def func2(): d = 1 …
user1659464
  • 313
  • 1
  • 3
  • 9
16
votes
1 answer

Pylint: Avoid checking INSIDE DOCSTRINGS (global directive / rcfile)

Consider this piece of code: def test(): """This line is longer than 80 chars, but, for me this is ok inside a DOCSTRING, this one is shorter. """ if 'This is toooooooooooooooooooooooooooooooooooo longggggggggggggggggggggggg': …
Juan Diego Godoy Robles
  • 14,447
  • 2
  • 38
  • 52
16
votes
1 answer

How does pylint remember scores from previous runs?

In a typical pylint run, we get the following output: Global evaluation ----------------- Your code has been rated at 9.50/10 (previous run: 8.50/10) Duplication ----------- +-------------------------+------+---------+-----------+ | …
Kaushik Pavani
  • 381
  • 4
  • 10
16
votes
3 answers

pylint not recognizing some of the standard library

I'm using pylint + pydev, with python 2.6. I have a module with just this line of code from email import Message Now when I try to run this module it runs fine. But pylint reports an error: ID: E0611 No name 'Message' in module 'email' Although it…
olamundo
  • 23,991
  • 34
  • 108
  • 149
15
votes
4 answers

How do I exclude South migrations from Pylint?

I'm using South for migration in my Django project. When I run Pylint on my project I get a bunch of errors from the migration files. How can I exclude migration files from Pylint? I'm on a Windows system so I can't use filename exclusions in the…
Mridang Agarwalla
  • 43,201
  • 71
  • 221
  • 382
15
votes
1 answer

Pylint: Specifying exception names in the overgeneral-exceptions option without module name is deprecated

pylint: Command line or configuration file:1: UserWarning: Specifying exception names in the overgeneral-exceptions option without module name is deprecated and support for it will be removed in pylint 3.0. Use fully qualified name (maybe…
Aseem
  • 5,848
  • 7
  • 45
  • 69
15
votes
1 answer

Use lazy % formatting in logging functions pylint error message

I have a python function as follows, when enabled pylint to code scan, it throws me an lazy formatting error. def modify_response(data): try: response = {} response["User_ID"] = data[0]["User_ID"]["S"] …
ashakshan
  • 419
  • 1
  • 5
  • 17
15
votes
1 answer

why does pylint complain about Unnecessary "elif" after "return" (no-else-return)?

why does pylint complain about this code block? R1705: Unnecessary "elif" after "return" (no-else-return) def f(a): if a == 1: return 1 elif a == 2: return 2 return 3 To prevent the error, I had to create a temporary…
zyxue
  • 7,904
  • 5
  • 48
  • 74
15
votes
1 answer

PyLint W0108: Lambda may not be > necessary (unnecessary-lambda)

pylint is returning the below message for the code that I have below : data.py:125:30: W0108: Lambda may not be necessary (unnecessary-lambda) in_p = ', '.join(list(map(lambda x: "'{}'".format(x), data))) Why is lambda not required here and how…
Punter Vicky
  • 15,954
  • 56
  • 188
  • 315
15
votes
2 answers

Avoiding pylint complaints when importing Python packages from submodules

Background I have a Python application dependent upon another package which is provided as a git submodule, yielding a directory structure similar to the following: foo/ bar/ bar/ __init__.py eggs.py …
pydsigner
  • 2,779
  • 1
  • 20
  • 33
15
votes
5 answers

Pylint: Disable Unnecessary "else" after "return" (no-else-return) warning

I'm looking through my RC file and I can't for the life of me, find which one of these variables disables that feature. I searched for "if", "else" and "return" and I didn't see anything. Unless I've missed it. Thanks. More Info pylint…
Yogurt
  • 2,913
  • 2
  • 32
  • 63
15
votes
1 answer

Pylint for half-implemented abstract classes

Consider following code snippet: class AbstractClass(object): def method1(self): raise NotImplementedError() def method2(self): raise NotImplementedError() class SemiConcreteClass(AbstractClass): def method1(self): …
Łukasz Rogalski
  • 22,092
  • 8
  • 59
  • 93
14
votes
3 answers

Pylint recursively for a given filename

I have a Django project and I'm working on Pylinting my way through it. I have a couple situations where I'd like to be able to recursively find all files with a given name and pylint them differently (using different options). For example, I'd like…
Brant
  • 5,721
  • 4
  • 36
  • 39