Git Product home page Git Product logo

Comments (7)

pylint-bot avatar pylint-bot commented on May 28, 2024

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.

pylint-bot avatar pylint-bot commented on May 28, 2024

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.

pylint-bot avatar pylint-bot commented on May 28, 2024

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.

pylint-bot avatar pylint-bot commented on May 28, 2024

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.

pylint-bot avatar pylint-bot commented on May 28, 2024

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.

pylint-bot avatar pylint-bot commented on May 28, 2024

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.

pylint-bot avatar pylint-bot commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.