Skip to content

Add an option for COM812 to disable for single-argument functions? #18258

@davidt

Description

@davidt

Summary

I really want to be able to use the COM812 rule, but our codebase contains a ton of code like the following:

some_string = gettext(
    'This is a long string which '
    'is marked for internationalization'
)

another_function(
    some_long +
    expression +
    gets_passed
)

While trailing commas do make a lot of sense for function calls that contain multiple arguments, for functions that take a single argument, requiring them muddies the syntax. I'd love to have an option for the flake8-commas plugin (something like [lint.flake8-commas] allow-single-arg-function-calls = true)

I'm happy to do the implementation for this, but I wanted to check in first to see if this is something that would be accepted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    configurationRelated to settings and configurationneeds-decisionAwaiting a decision from a maintainerruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions