pylint
pylint copied to clipboard
It's not just a linter that annoys you!
### Bug description ```python # pylint: disable=missing-module-docstring,missing-class-docstring,too-few-public-methods def func1(): # pylint: disable=line-too-long print('looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong statement') # pylint doesn't like this long comment if it's after all this function's statements, but it's...
### Bug description ```python After upgrading to `typing_extensions==4.12.0`, pylint is raising the following error for `TypeVar`s that have default values: E1123: Unexpected keyword argument 'default' in constructor call (unexpected-keyword-arg) ```...
### Bug description ```python # pylint: disable=missing-module-docstring,invalid-name a = bool(input()) b = bool(input()) if a: c = 123 if a and b: print(c) # report possibly-used-before-assignment if a: c +=...
### Bug description When using the ctypes module, disable=invalid name pragmas get ignored when accessing fields of classes which inherit Structure. Context level, line level and module level ignores all...
### Bug description I try to use `allow-any-import-level` but it does not seem to have any effect. With a module with: ```python MY_CONST = 1 import numpy print(numpy) ``` `pylint...
### Current problem - [x] We have to cherry-pick manually #7776 - [x] contributor-txt pollutes the contributor file with a header because it does not detect the existing header fixed...
### Bug description The following raises a `E1101: Generator 'generator' has no 'bit_count' member (no-member)`: ```python #pylint: disable=C0114,C0116 from contextlib import contextmanager from typing import Generator def subgenerator() -> Generator[int,...
### Bug description ```python """The following code should lint ok, but pylint issues undefined- / unused-variable l""" import pytest @pytest.mark.parametrize("x", l := [1, 2, 3]) @pytest.mark.parametrize("y", l) def test_demo(x, y):...
undefined-variable/possibly-used-before-assignment/used-before-assignment false positives for global
### Bug description 1. Code below leads to undefined-variable false positive: ```python if __name__ == "__main__": global g_object if "g_object" not in globals(): g_object = 1 g_object += 1 ```...
### Bug description ```python """doc""" def f(): """doc""" for i in []: if i: fail1 = 42 print(fail1) # bug detected for i in []: fail2 = 42 print(fail2) #...