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
10
votes
1 answer

pylint: Exclude directory

Suppose I have the following directory structure: adir/ __init__.py afile.py bdir/ __init__.py bfile.py adir/ __init__.py afile.py I want to run pylint on everything, except the directory bdir/adir. Is there any way to do this? …
Peter
  • 12,274
  • 9
  • 71
  • 86
10
votes
1 answer

python: pycodestyle (ex pep8) vs pylint strictness

I have a python project that I want to check against PEP8 conformance. My setyp.cfg is the following: [pycodestyle] count = True ignore = E266, W504 max-line-length = 80 statistics = True exclude = .venv,./build% After some cleaning up, my…
pkaramol
  • 16,451
  • 43
  • 149
  • 324
10
votes
1 answer

pylint W0622 (Redefining built-in) when overriding "standard" methods in subclasses

In Python, many methods define argument variables with "standardized" names, like: def __exit__(self, type, value, traceback): In the line above, variable type causes pylint to warn (W0622) that a built-in is being redefined: Redefining built-in…
Starnuto di topo
  • 3,215
  • 5
  • 32
  • 66
10
votes
2 answers

pylint only showing errors in VSCode

If I have the following code: print("hello") a = 2 b =3 print "hello" The only pylint message I get within VSCode or the command line is: Missing parentheses in call to 'print'. Did you mean print("hello")? (, line 4) pylint(syntax-error)…
Neil Walker
  • 6,400
  • 14
  • 57
  • 86
10
votes
2 answers

VsCode Remote Debugging, change pythonpath to point to docker container's python interpreter

I currently have a tensorflow-gpu docker container fully built. I have a volume from my host's workspace ($PWD) to /workspace inside the docker container. I can successfully remote debug the python scripts inside my workspace/docker's workspace…
10
votes
1 answer

Grouping import statements in python

I have started learning python recently and ran pylint on my python file. I got following comments. from os import listdir from os.path import isfile, join I the above two lines, the Pylinter comment is C: 5, 0: Imports from package os are not…
ankit
  • 1,499
  • 5
  • 29
  • 46
10
votes
2 answers

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…
Kamal Pandey
  • 182
  • 1
  • 1
  • 14
10
votes
3 answers

How can I get pylint to use python 3 in VS code?

I want pylint to use python3 for linting in Visual Studio code on Mac (which has both python 2.7 standard and python 3.6). I've tried changing the path to the python interpreter as per How can I debug Python3 code in Visual Studio Code, to no…
10
votes
3 answers

Start PyLint from correct anaconda environment in Visual Studio Code

I'm trying to make PyLint automagically use correct conda environment inside vscode but still getting import errors: [pylint] E0401:Unable to import 'django', although: I'm starting vscode from correct environment. [1] I have installed Python…
pkowalczyk
  • 16,763
  • 6
  • 27
  • 35
10
votes
1 answer

Is it possible to pylint for a specific error code?

I want to pylint a project against unused imports to make upgrading a module easier (W0611).
James
  • 2,742
  • 1
  • 20
  • 43
10
votes
1 answer

Pylint infinite recursion in astriod package

I have a following code snippet, that pylint cannot handle: from celery import Celery def create_celery(application): """ Configures celery instance from application, using it's config :param application: Flask application instance …
Nikolai Golub
  • 3,327
  • 4
  • 31
  • 61
10
votes
1 answer

Why does pylint assume module-level variables are constants?

In the answer to how to stop Pylint message C0103, @ChristopheD accurately mentioned that "pylint interprets all module-level variables as being 'constants'." I like Pylint, and suppose that the authors have code-quality-encouraging reasons for its…
talkaboutquality
  • 1,312
  • 2
  • 16
  • 34
10
votes
2 answers

Get static code analyzer messages only from 'git diff'?

In our build system (with sources under git version control), I'd like to get the static code analyzer (pylint, in this case) messages for every build. And I want them incremental: in the new build report, only the messages introduced by new commits…
Konstantin Shemyak
  • 2,369
  • 5
  • 21
  • 41
10
votes
3 answers

Is this possible > Sublime3 + a python linter + virtualenv?

I've read a lot of conflicting SO posts, gone through all the relevant github issues I could find, and tried a myriad of config options in various sublime config files before finally giving up and resorting to this plea for help. It's as the title…
rix
  • 10,104
  • 14
  • 65
  • 92
10
votes
1 answer

How do I make pylint recognize twisted and ephem members?

I very much like having pylint tell me if I'm using a non-existent member. However, my new project is using both twisted and the ephem modules, which seem to confuse pylint. How can I get rid of these (incorrect) pylint warnings without either…
DonGar
  • 7,344
  • 8
  • 29
  • 32