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

what is best practice to control "too many local variable in a function" without suppress and manipulate pylint settings?

I'm working to make sure python code files must be 10/10 score with regular pylint and pycodestyle. but, I'm getting hard change from "too many local variable" in the functions. The functions could to split due to timing issue of whole suite. please…
Jatinder Singh Brar
  • 421
  • 1
  • 5
  • 11
24
votes
7 answers

Tox WARNING:test command found but not installed in testenv

I am using tox for my project. Here is my tox.ini file: [tox] envlist = py27, lint, coverage skipsdist = True [testenv:py27] deps = -rrequirements.txt commands = python -m unittest discover -s ./tests [testenv:coverage] commands = …
primer
  • 381
  • 1
  • 2
  • 7
24
votes
3 answers

Setting up Pylint with PyDev

I have installed pylint via easy_install. I can run pylint with success. But pydev refuses to use it. I checked "use pylint" I configured correct path I updated my python interpreter in eclipse to have pylit in pythonpath I use Eclipse…
Kugel
  • 19,354
  • 16
  • 71
  • 103
23
votes
4 answers

How to use Pylint or other linters with Jupyter Notebooks?

Is it possible to have a linter inside of a Jupyter Notebook?
magisterbrownie
  • 233
  • 1
  • 3
  • 6
23
votes
4 answers

Change default python coding style

In python i'm following camelCase Naming style. I checked my code with "pylint" and it gives error for not following lower_case_with_underscores style. Also i use netBeans IDE for coding. This IDE gives warning for not following…
Netro
  • 7,119
  • 6
  • 40
  • 58
23
votes
5 answers

Method name doesn't conform to snake_case naming style

I’m creating a simple project with my pylintrc file and get this error for the test method: method name - test_calculator_add_method_returns_correct_result - doesn't conform to snake_case naming style class TddInPythonExample(unittest.TestCase): …
user1050619
  • 19,822
  • 85
  • 237
  • 413
23
votes
4 answers

How can I use Emacs Flymake mode for python with pyflakes and pylint checking code?

For checking code in python mode I use flymake with pyflakes Also I want check code style (pep8) with pylint (description on the same page with pyflakes) This solutions work. But I can't configure flymake for work with pyflakes and pylint…
dixon
  • 1,265
  • 2
  • 9
  • 10
22
votes
2 answers

Why does PyLint warn about no __init__?

We have numerous python classes that do not seem to need __init__, initialising them empty is either perfectly acceptable or even preferable. PyLint seems to think this is a bad thing. Am I missing some insight into why having no __init__ is a Bad…
Pete
  • 1,241
  • 2
  • 9
  • 21
22
votes
3 answers

Tool to help eliminate wildcard imports

I'm refactoring and eliminating wildcard imports on some fairly monolithic code. Pylint seems to do a great job of listing all the unused imports that come along with a wildcard import, but what i wish it did was provide a list of used imports so I…
Paul
  • 2,973
  • 6
  • 31
  • 40
22
votes
5 answers

How do you fix "Missing module docstringpylint(missing-module-docstring)"

I'm using the pygame module on VS Code and I ran into the issue where the pygame has not init member. I followed the solutions to this link. I edited the user settings and added "python.linting.pylintArgs": [ …
22
votes
1 answer

Pylint variable name doesn't conform to snake_case naming style

I have multiple warnings from pylint like that: '''Variable name "df" doesn't conform to snake_case naming style''' As I could understand, it happens because of variable name length less than 3 symbols. however I would like to use variables like df,…
Alexander
  • 391
  • 1
  • 3
  • 10
22
votes
3 answers

Simplifying an 'if' statement with bool()

I have some code that causes Pylint to complain: The if statement can be replaced with 'var = bool(test)' (simplifiable-if-statement)` The code (with obfuscated variable names) is below. A = True B = 1 C = [1] D = False E = False if A and B in…
Gary
  • 3,891
  • 8
  • 38
  • 60
22
votes
3 answers

pylint can't find QWidget and QApplication

import sys from PyQt5.QtWidgets import (QApplication, QWidget) app = QApplication(sys.argv) window = QWidget() window.setGeometry(50, 50, 500, 300) window.setWindowTitle('Hello, world') window.show() sys.exit(app.exec_()) I just started to learn…
Sergey
  • 421
  • 1
  • 5
  • 14
22
votes
3 answers

Pylint giving me "Final new line missing"

Pylint complains on last line where I'm calling function deletdcmfiles(). Final newline missing. I'm new to python and I'm not sure what is triggering this? Here is the code of the program: ''' This program will go through all Work subdirectorys in…
Nermin Kekic
  • 393
  • 2
  • 6
  • 12
22
votes
1 answer

Is it possible to disable pylint missing docstring error for short functions and methods?

Pylint reports an error for every function and method (except __init__) that has no docstring. This is generally desirable, so I don't want to disable it globally (in pylintrc, or at file level). However, in my opinion, there are cases where a…
Itamar
  • 1,089
  • 1
  • 10
  • 18