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
29
votes
8 answers

No name 'QApplication' in module 'PyQt5.QtWidgets' error in Pylint

Running into this issue in VS Code while trying to learn PyQt5, "No name 'QApplication' in module 'PyQt5.QtWidgets'", "No name 'QWidget' in module 'PyQt5.QtWidgets'"". I'm not sure if this is a pylint issue or something else. I've confirmed PyQt5 is…
wolfeyes90
  • 1,022
  • 1
  • 8
  • 15
29
votes
4 answers

How can I set the Python max allowed line length to 120 in Syntastic for Vim?

I'm using python-mode for Vim, I prefer for there to be 120 character lines rather than the stark 80 as defined in the PEP8 standard. In python-mode, this is easy. I just add the following to my ~/.vimrc: " Pylint configuration file let…
feoh
  • 1,281
  • 1
  • 14
  • 19
28
votes
5 answers

Pylint best practices

Pylint looks like a good tool for running analysis of Python code. However, our main objective is to catch any potential bugs and not coding conventions. Enabling all Pylint checks seems to generate a lot of noise. What is the set of Pylint features…
amit
  • 10,612
  • 11
  • 61
  • 60
28
votes
4 answers

Python coding convention "Wrong continued indentation before block: found by pylint

I used pylint to check my python code, and found this convention problem: C:11, 0: Wrong continued indentation before block. + this_time <= self.max): ^ | (bad-continuation) I tried to refine for times but…
Reed_Xia
  • 1,300
  • 3
  • 17
  • 29
28
votes
1 answer

How to handle the pylint message: ID:W0612 Unused Variable

I'm updating some code to PEP 8 standard using pylint. Part of the code is throwing the W0612 unused variable error but it's because it's using a module that returns (x,y) for example when only x is needed in this particular case, this is what's…
Jacxel
  • 1,634
  • 8
  • 22
  • 33
27
votes
9 answers

enabling pylint_django plugin in vscode, pylint stop working

That's my user settings in vscode { "python.pythonPath": "/Users/cristiano/miniconda3/envs/django-rest-2/bin/python", "python.linting.pylintEnabled": true, "python.linting.enabled": true, "python.linting.pylintArgs": [ "--load-plugins", …
Crixo
  • 3,060
  • 1
  • 24
  • 32
27
votes
4 answers

Use PyLint on Jenkins with Warnings Plugin and Pipeline

I want to use PyLint on Jenkins with Warnings Plugin and Pipeline, since Violations plugin is deprecated. There are no docs or complete examples. There is some information: timeout(time: 5, unit: 'MINUTES') { sh 'npm run lint:ci' step([$class:…
Paweł Prażak
  • 3,091
  • 1
  • 27
  • 42
27
votes
11 answers

pylint doesn't point to virtualenv python

I am pretty new to python and currenty I am trying to use pylint for checking code quality. I am getting a problem. My pylint doesn't point to virtualenv python interpreter. Here is the output that I get when I run pylint --version $ pylint…
hjelpmig
  • 1,406
  • 6
  • 19
  • 23
26
votes
6 answers

pylint warning on 'except Exception:'

For a block like this: try: #some stuff except Exception: pass pylint raises warning W0703 'Catch "Exception"'. Why?
yanchenko
  • 56,576
  • 33
  • 147
  • 165
26
votes
7 answers

Why is imperative mood important for docstrings?

The error code D401 for pydocstyle reads: First line should be in imperative mood. I often run into cases where I write a docstring, have this error thrown by my linter, and rewrite it -- but the two docstrings are semantically identical. Why is it…
Richard
  • 459
  • 1
  • 5
  • 8
26
votes
4 answers

How to use yapf (or black) in VSCode

I installed yapf using: conda install yapf and add next lines in my .vscode/settings.json file: { //"python.linting.pylintEnabled": true, //"python.linting.pycodestyleEnabled": false, //"python.linting.flake8Enabled": true, …
Mikhail_Sam
  • 10,602
  • 11
  • 66
  • 102
26
votes
5 answers

Using Pylint in Ipython (Jupyter-Notebook)

I want to run Pylint or any equivalent while using Jupyter-Notebook. Is there a way to install and run Pylint this way?
mccurcio
  • 1,294
  • 5
  • 25
  • 44
26
votes
1 answer

Disable all `pylint` 'Convention' messages

Background I find pylint useful, but I also find it is horrifically undocumented, has painfully verbose output, and lacks an intuitive interface. I'd like to use pylint, but it keeps pumping out an absurd number of pointless 'convention' messages,…
Brian M. Hunt
  • 81,008
  • 74
  • 230
  • 343
25
votes
7 answers

how to use pylint in vim

I do not want to install another plugin, like pylint.vim, And today, I decide to use vim edit python instead of pydev which is a eclipse plugin. But I got issues. I have add this in my vimrc autocmd BufWritePost *.py !pylint but pylint does…
guilin 桂林
  • 17,050
  • 29
  • 92
  • 146
25
votes
2 answers

How do I get Pylint message IDs to show up after pylint-1.0.0?

Starting with pylint-1.0.0 the --include-ids argument is no longer allowed. How do I get: ************* Module foo.bar E:199,11: Module 'yaml' has no 'scanner' member (no-member) ************* Module foo.baz W:153,27: Unused variable '_filenames'…
Jace Browning
  • 11,699
  • 10
  • 66
  • 90