Skip to content

Allow certain short argument/variable names that make perfect sense #2709

New issue

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

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

Already on GitHub? # to your account

Closed
matkoniecz opened this issue Jan 28, 2019 · 4 comments
Closed

Comments

@matkoniecz
Copy link

Is your feature request related to a problem? Please describe

pylint complains about variable/argument names like x, y.

Describe the solution you'd like

Whitelist variable names that are typically OK despite being really short

Additional context

See https://github.com/mkenyon/rubocop/blob/master/config/default.yml#L792 for how Rubocop (linter for Ruby) solves it for their UncommunicativeMethodParamName equivalent

See #2018 for a related problem where short names are misleadingly described as not being snake_case

@PCManticore
Copy link
Contributor

Please check the good-names option, which does exactly this.

@gitaarik
Copy link

gitaarik commented Apr 2, 2019

And what about function/method names? A function with a 2-letter name gives an warning. I don't see a good-func-names option.

@PCManticore
Copy link
Contributor

@gitaarik You are probably interested in configuring function-rgx: http://pylint.pycqa.org/en/stable/user_guide/options.html. There is no good-func-names because it does not make sense to have one. While good-names is a finite number of variables names, a function name cannot be easily determined to be good or not.

@gitaarik
Copy link

Sorry, the good-names option apparently does work for me! I was just editing the wrong file 😂. Thanks anyway.

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

No branches or pull requests

3 participants