Comments (7)
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?):
we need (much) deeper understanding of decorators in astroid for this.
in the mean time a custom transform should do the trick (requires forthcoming transformation API).
from pylint.
Original comment by BitBucket: mitar, GitHub: @mitar?:
So in current stable version this is not possible to achieve? Is there some other way?
from pylint.
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?):
the release should come until the end of july. The easiest you can do remains to disable this false positive manually using inline # pylint: disable pragma.
from pylint.
Original comment by BitBucket: mitar, GitHub: @mitar?:
I already have custom checkers so there is no problem adding more. :-) If there is/will be a way. :-)
from pylint.
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?):
in this case you'll have to use astroid (former astng) API to detect usage of your decorator and then hack the underlying function node arguments.
You may want to take a look at pylint/astroid tip, read astroid/doc/extending.rst and some code, then try and ask questions on python-projects or code-quality mailing list (doc is rather rough but that would be a good occasion to enhance it)
from pylint.
Original comment by BitBucket: mitar, GitHub: @mitar?:
I survived until now with reading existing checkers and object introspection. :-)
But yes, a good idea. I could just override values and set name of decorator to "staticmethod".
from pylint.
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):
Solved with https://bitbucket.org/logilab/astroid/commits/05d0fbdee9d6d26e024cfe9ea32d18e543373321 in astroid. Now pylint has a basic understanding of decorator chaining and tries to infer what those decorators return, but again, it's not exhaustive.
from pylint.
Related Issues (20)
- Check "__slots__" and "@dataclass" attributes HOT 2
- ERROR: Could not install packages due to an OSError HOT 1
- Add a dynamic URL to the message documentation in the message descriptions from checkers HOT 12
- Using truethy coroutine in if-clause should trigger a warning HOT 5
- cannot disable checks right after "else:" HOT 1
- Changing the number of function arguments when using a decorator does not work. HOT 2
- Document the setting of the ``sys/PYTHONPATH`` in our doc and on a popular stackoverflow answer
- Detect useless copy/deepcopy HOT 1
- Proposal: ignore concrete linting warnings via GUI, e.g. via QuickFix in VSCode HOT 2
- Misleading documentation for "protected-access / W0212" HOT 8
- False negative for used-before-assignment and unused-argument when used in inner function without nonlocal HOT 4
- Pylint failed to detect undefined variable value HOT 1
- [unsubscriptable-object] False Positive on Optional list HOT 1
- Streamlit page with ChatBot Langchain and Bedrock HOT 1
- Missing timeout for requests.Session object? HOT 1
- False positive for missing-kwoa (E1125) on inherited dataclasses with kw_only=True HOT 2
- [no-value-for-parameter] False negative when calling `super().__init__()` with non-self argument HOT 1
- PyLint reports "no assignment is done" but variable is changed in the scope of the procedure HOT 4
- [MacOS] astroid.exceptions.AstroidError thrown when multi-processing
- Crash: Fatal error while checking 'models.py' HOT 1
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.