Comments (3)
By sometime do you mean in the same environment when calling pylint multiple time ? Or are you using multiple interpreters or multiple environments (differing dependencies, OS, etc) ? Also you could upgrade pylint to 3.0.0a7 to see if the problem still exists :)
from pylint.
@Pierre-Sassoulas The exact same environment but with different command executions (where the command is poetry run pylint my_package tests docs scripts --enable=useless-suppression
) - nothing else changes, just different executions of the same command can lead to different outputs (warning and no warning). I can't still upgrade pylint to the latest version because it's incompatible with Python 3.7, which my packages still supports (although we'll soon remove that support). This behaviour is really strange. This probably happening, I would guess, because something is not deterministic. Maybe the way the AST is parsed or the order of the execution of pylint on the different files.
from pylint.
So if I understand you well you launch once with --enable=useless-suppression
and the other without ? The code you gave is not parseable (a.py:7:38: E0001: Parsing failed: 'unterminated string literal (detected at line 7) (<unknown>, line 7)' (syntax-error)
) so I parsed the following using both option:
from pathlib import Path
from unittest import mock
MODULE_PATH = Path(__file__)
def whatever():
mocks = mock.patch.multiple_targets( # pylint: disable=no-member
[
mock.patch(MODULE_PATH + '.func1'),
mock.patch(MODULE_PATH + '.func2'),
]
)
I don't have any issues on main / python 3.11 with this snippet. We did change a lot of things since 2.14, and some for useless-suppression (maybe #7887 in 2.15, but there might be others), so it's probable it was fixed on main and sadly we don't support python 3.7 anymore. Please reopen an issue if you have a reproducer for more recent version of pylint.
from pylint.
Related Issues (20)
- Suggestion conflicting with black 2024 style for inlined semantic / empty classes HOT 7
- False Positive: `no-member` for `ParamSpec` under Python 3.12 HOT 8
- [unknown-option-value] False negative after `--disable=all` HOT 3
- False negative: no-member in conditional branch HOT 2
- [unsubscriptable-object] FP for generic classes (PEP 695) HOT 2
- pyreverse tracking and drawing class data member relations in addition to instance data members (maybe enable/disable option). fixes attrs.org
- [duplicate-code] unclear how to disable the message for select occurrences, while keeping the option enabled in general
- Feature Request: Naming Convention Enforcement for Boolean Values & Functions HOT 8
- Pylint incorrectly resolving type vs instances HOT 1
- astroid.node Attribute Error HOT 1
- protected-access false positive in class method of child class HOT 1
- unused-argument in .pyi stub file HOT 1
- too-many-try-statements should exclude `pass` statements if required by Python HOT 2
- `too-few-public-methods` counts dunder methods as private HOT 2
- `unexpected-keyword-arg` (E1123) and `missing-kwoa` (E1125) false positives with changing dict
- [Enhancement] `newline` argument for `csv.reader()`
- pylint's type checker ignores type interface files HOT 6
- False positive: overriding a generic `ParamSpec` method triggers `arguments-differ` (W0221)
- false positive: no-member when importing from matplotlib.cm
- False positive: import-error and no-name-in-module when importing from python-docx HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylint.