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

(🎁) Rule for providing keyword argument when non-meaningful literal is passed as positional argument #4235

Open
KotlinIsland opened this issue May 5, 2023 · 1 comment
Labels
needs-decision Awaiting a decision from a maintainer rule Implementing or modifying a lint rule

Comments

@KotlinIsland
Copy link
Contributor

For the following call:

a = textwrap.TextWrapper(70, "", "", True, True, False, True, True, False, 4)

It's very hard to understand what the code is doing. Instead you'd want to have keyword arguments:

a = textwrap.TextWrapper(
    width=70,
    initial_indent="",
    subsequent_indent="",
    expand_tabs=True,
    replace_whitespace=True,
    fix_sentence_endings=False,
    break_long_words=True,
    drop_whitespace=True,
    break_on_hyphens=False,
    tabsize=4
)           

Inspired by: pylint-dev/pylint#385

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label May 5, 2023
@charliermarsh
Copy link
Member

Reminiscent of the flake8-boolean-trap rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision Awaiting a decision from a maintainer rule Implementing or modifying a lint rule
Projects
None yet
Development

No branches or pull requests

2 participants