Skip to content

Adopting use of flake8 plugins #5537

Closed
Closed
@pradyunsg

Description

@pradyunsg

In general, there's some flake8 plugins that might be useful to us. In case of some of these plugins, it means adopting a newer code style so we should probably start with that discussion.

  • flake8-commas PyPI: enforce commas after the last item of multiline literals/function calls.
  • flake8-mutable PyPI: enforce not using mutable values as defaults
    • TODO: check if flake8 does this check by default
  • flake8-logging-format PyPI: check that strings aren't formatted while passing to logging (should depend on logging doing the interpolation)
  • flake8-pep3101 PyPI: enforces the use of .format instead of % in the codebase
  • flake8-gramex PyPI: checks for magic numbers and required encoding for calls to file opening functions + 2/3 more (but we'll ignore those)
    • It's documentation is lacking

I think some of these might be good additions. The only thing is that adopting them would mean going through the entire codebase to make things consistent according to them wherever there's a violation (which is kind of the point of doing this).

Thoughts @pypa/pip-committers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedFor requesting inputs from other members of the communitytype: maintenanceRelated to Development and Maintenance Processes

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions