Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can choose decorators that mutate a function's signature #2926

Merged
merged 2 commits into from
May 23, 2019
Merged

Conversation

AWhetter
Copy link
Contributor

Description

This adds a new option function_mutators that allows too-many-function-args, unexpected-keyword-arg, and no-value-for-parameter to not get raised for functions that are decorated with a decorator mentioned in function_mutators.

I figured it would be too difficult to try and infer what a decorator was doing so this seemed like the best solution, even though it means that there will be cases where a function is called with incorrect arguments will be missed by pylint when the function is decorated with a mutator decorator.

Type of Changes

Type
βœ“ πŸ› Bug fix
βœ“ ✨ New feature
πŸ”¨ Refactoring
πŸ“œ Docs

Related Issue

Close #259

@coveralls
Copy link

coveralls commented May 20, 2019

Coverage Status

Coverage increased (+0.002%) to 90.081% when pulling 3b1247f on fix_259 into 3dd27c9 on master.

@PCManticore PCManticore merged commit f90b223 into master May 23, 2019
@PCManticore PCManticore deleted the fix_259 branch May 23, 2019 06:17
@schrockn
Copy link

schrockn commented Aug 27, 2019

This is an awesome change and thanks for the hard work on this project! Would absolutely love it if this was incorporated into a new release. Looks like there hasn't been once since March?

@PCManticore
Copy link
Contributor

Not yet @schrockn but the new release would happen very soon.

@iddan
Copy link

iddan commented Dec 2, 2019

Any update regarding the release?

@muneebabbas93
Copy link

@PCManticore This very simple change would allow us to remove a bunch of # pylint: disable=no-value-for-parameter. Any chance of this getting a release in the 1.9 branch? :)

Serves us right for still using python 2 though :(

@beasteers
Copy link

this is great! Is there a way to define function_mutators using inline comments (e.g. # pylint: function_mutator)? It would be nice if we could avoid having to maintain a separate list that I'm inevitably going to forget to update.

@hippo91
Copy link
Contributor

hippo91 commented Dec 20, 2020

@beasteers it don't seem so. The only way seems to use the rcfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decorators confuse E1120 analysis
8 participants