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
48
votes
12 answers

Why does it say that module pygame has no init member?

This is the code I have: import pygame pygame.init() I'm very confused because if I try to run the file, then there seems to be no issue, but pylint says the following: E1101:Module 'pygame' has no 'init' member I have searched thoroughly for a…
Ludde
  • 481
  • 1
  • 4
  • 3
47
votes
5 answers

Error message "python-pylint 'C0103:Invalid constant name"

I'm confused about the error(s) in this photo: I don't know how to fix them. My program is a Python-Flask web frame. When I use Visual Studio Code to debug my program, Pylint shows these errors. I know this problem doesn't matter, but it makes me…
Xing
  • 167
  • 1
  • 4
  • 8
45
votes
5 answers

Silence PyLint warning about unused variables for string interpolation

The say module brings string interpolation to Python, like this: import say def f(a): return say.fmt("The value of 'a' is {a}") However, PyLint complains that the variable 'a' is never used. This is a problem because my code uses say.fmt…
Eleno
  • 2,864
  • 3
  • 33
  • 39
44
votes
10 answers

Invoking Pylint programmatically

I'd like to invoke the Pylint checker, limited to the error signalling part, as part of my unit testing. So I checked the Pylint executable script, got to the pylint.lint.Run helper class and there I got lost in a quite long __init__ function,…
mariotomo
  • 9,438
  • 8
  • 47
  • 66
44
votes
4 answers

List of pylint human readable message ids?

Recent versions of pylint allow for suppressing messages with human readable message ids. For example, instead of class MyTest(unittest.TestCase): # pylint: disable=R0904 ... you can specify: class MyTest(unittest.TestCase): # pylint:…
Frank Niessink
  • 1,611
  • 12
  • 24
43
votes
6 answers

Instance of 'SQLAlchemy' has no 'Column' member (no-member)

I'm currently trying to implement steam login into website. But I'm unable to get pass this error within the code. I've created the database object but it keeps showing the error I mentioned earlier. I'm not sure whether SQLAlchemy has changed or…
Vice Kay
  • 535
  • 1
  • 5
  • 8
43
votes
3 answers

Disabling Pylint no member- E1101 error for specific libraries

Is there anyway to hide E1101 errors for objects that are created from a specific library? Our large repository is littered with #pylint: disable=E1101 around various objects created by pandas. For example, pylint will throw a no member error on…
Michael WS
  • 2,450
  • 4
  • 24
  • 46
42
votes
2 answers

Pylint: Disable specific warnings for specific folder

We have a Python project laid out like this: project/ ├── .pylintrc ├── module1.py ├── module2.py └── tests/ ├── test_module1.py └── test_module2.py Our unit and function tests reside in the folder called tests/. When it comes to tests the…
imolit
  • 7,743
  • 3
  • 25
  • 29
40
votes
4 answers

Python global keyword vs. Pylint W0603

Pylint W0603 states: Using the global statement. Used when you use the "global" statement to update a global variable. PyLint just try to discourage this usage. That doesn't mean you can not use it ! I wonder why is it so? Is there any more…
Jovik
  • 4,046
  • 6
  • 24
  • 24
40
votes
6 answers

Can Pylint error checking be customized?

I am using pydev where I have set up pylint. The problem is that even inside the comments, pylint reports warnings. I was looking to disable any sort of checking inside any line or a block comment. Also, I wish to follow camelCase naming convention…
Sumit Bisht
  • 1,507
  • 1
  • 16
  • 31
39
votes
6 answers

Visual Studio code with PyLint and autoPep8: How can I avoid PyLint to complain about my line length?

I recently switched to Visual Studio Code and I have to say I love it so far. I'm working on a Python project, which includes the pip packages pylint and autopep8 and I configured VSCode to format the code according to these packages. Only problem…
J. Hesters
  • 13,117
  • 31
  • 133
  • 249
38
votes
8 answers

How do I disable pylint unused import error messages in vs code

How do I disable these error messages from popping up in the problems box in vs code
Turtle Gurgle
  • 391
  • 1
  • 3
  • 4
37
votes
1 answer

How can I configure Pylint to check all things PEP8 checks?

Searching for an answer on Pylint's mailing list brings no interesting results. Pylint is known to be very customizable, so I guess this should be possible... The reason I would like Pylint to check compliance with PEP8 is because PyDev has much…
Piotr Dobrogost
  • 41,292
  • 40
  • 236
  • 366
37
votes
2 answers

Pylint W0212 protected-access

In Python, prefixing with one underscore indicates that a member should not be accessed outside of its class. This seems to be on a per-class basis like Java and C++. However, pylint seems to enforce this convention on a per-object basis. Is there…
Jim K
  • 12,824
  • 2
  • 22
  • 51
36
votes
2 answers

Pylint warning for "useless super delegation"

Pylint raises the warning: Useless super delegation in method '__init__' (useless-super-delegation) for the SpecificError class below. class MyProjectExceptions(Exception): """The base class for all my project's exceptions.""" def…
mugwump
  • 436
  • 1
  • 4
  • 10