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
14
votes
2 answers

How to correctly import a Python module in VS Code?

I've recently started programming in Python and I've decided to code some Delphi functions in Python. I've decided to create a single Python module that holds my functions. Now, I tried to import it, but I get this error in Visual Studio…
Romans
  • 469
  • 1
  • 4
  • 17
14
votes
5 answers

Python correctness (i.e., lint) analyzing for Notepad++

Does anyone know of anything like pylint or pychecker for notepad++? Or perhaps how to use pylint in notepad++.
Belmin Fernandez
  • 8,307
  • 9
  • 51
  • 75
14
votes
3 answers

VS Code shows an error message at print statement in python 2.7

I use VS Code Version 1.19.3 with Python 2.7 on Windows. Recently pylint (code analyzer) shown an error message "E1601:print statement used" But I don't know why! Can someone help me? The print statement is correct as per my knowledge! Is it a…
Georg Gutsche
  • 452
  • 4
  • 9
  • 17
14
votes
5 answers

How to setup working directory in VS Code for pylint?

I have a project with that structure: ├── .git ├── .gitignore ├── README.md ├── requirements.txt └── src Pylint by default running from project root and I have error on all my imports, because source root in src directory. I try to setup the…
Arr
  • 749
  • 3
  • 6
  • 15
13
votes
1 answer

pylint import error in vscode even though python executer successfully imports it

I am using vscode for coding my python code. I use pandas, numpy and requests library in my code. If I run the code, It works fine. But in VScode editor, in the problems section, always Its says the message as Unable to import 'numpy' (pylint…
Smith Dwayne
  • 2,675
  • 8
  • 46
  • 75
13
votes
1 answer

Pylint complains about comparing a string to a literal with 'is'

Consider this code snippet: my_string = 'asdf' print(my_string is 'xfje') #R0123 Pylint returns a recommendation R0123 on the second line, which I was unable to find on the error message wiki. There is a mention of it in this part of the docs,…
iFreilicht
  • 13,271
  • 9
  • 43
  • 74
13
votes
5 answers

Extracting Pylint Score

Does anyone know how to extract only the pylint score for a repository? So, assuming pylint produces the following output: Global evaluation ----------------- Your code has been rated at 6.67/10 (previous run: 6.67/10, +0.00) I would like it to…
Seán
  • 523
  • 2
  • 10
  • 17
13
votes
2 answers

running pep8 or pylint on cython code

Is there any way to use pep8 with cython files? pep8 does not work with operators for example. getline(& line) produces error: E225 missing whitespace around operator Now if i try to fix it and run this: getline( & line) produces error: E201…
Michael WS
  • 2,450
  • 4
  • 24
  • 46
13
votes
3 answers

Show only errors with pylint and syntastic in vim

How to use synstastic in vim to display only pylint error messages? I basically want the output of pylint -E to be used as source for syntastic. I tried to configure syntastic in my .vimrc with: let g:syntastic_python_checkers = ['python', 'pylint…
zormit
  • 533
  • 4
  • 16
13
votes
4 answers

Disable pylint execution on a section of code or function

I am using pylint 0.27 with python 2.7.3. Pylint has a known bug which hits when it analyses code having a .next() call. As given in http://www.logilab.org/122793 link, it fails with the given traceback. I cannot change my python and pylint versions…
Jatin Kumar
  • 2,635
  • 9
  • 36
  • 46
13
votes
3 answers

Error "__init__ method from base class is not called" for an abstract class

I have class A(object): def __init__ (self): raise NotImplementedError("A") class B(A): def __init__ (self): .... and pylint says __init__ method from base class 'A' is not called Obviously, I do not want to do super(B,…
sds
  • 58,617
  • 29
  • 161
  • 278
13
votes
3 answers

How do I disable a Pylint specific error message globally?

I'm using Sublime Text editor with Pylint as a Python code parser. It works fine, BUT whenever I define a variable, I receive the following error message (C0103): Error: invalid constant name. I read in this topic that one solution could be adding…
renatov
  • 5,005
  • 6
  • 31
  • 38
13
votes
2 answers

How to make pylint a part of setup.py test process?

I'm trying to add pylint checking of all .py files to the test process of setuptools (maybe I'm doing something wrong, please correct me). This is what I'm doing in setup.py: class MyTest(test): def run_tests(self): import pytest import…
yegor256
  • 102,010
  • 123
  • 446
  • 597
13
votes
3 answers

How to set up Pylint to only do some inspections

I'm trying to set up Pylint to only do certain inspections and no others, e.g. only check for W0601 and W0612. I've tried using an enable= line the the [MESSAGES CONTROL] section of my pylint.rc but that doesn't seem to do what I want. I'm using…
Peter Graham
  • 11,323
  • 7
  • 40
  • 42
13
votes
2 answers

save pylint message to a file

Is there a built in way to save the pylint report to a file? It seems it might be useful to do this in order to log progress on a project and compare elements of reports across multiple files as changes are made.
Drew Verlee
  • 1,880
  • 5
  • 21
  • 30