Skip to content

Add black, pre-commit, or ruff action to aid in code style for developers #1356

@zm711

Description

@zm711

Is your feature request related to a problem? Please describe.
Pep8 speaks puts the onus on the developer to fix all the mistakes which are annoying to deal with. But using black/ruff as the developer would lead to huge diffs unless it is supported overall by the maintainers and eventually applied to the whole code base.

Based on discussion with @alejoe91 in #1318 (and I'm sure very much against the wishes of @samuelgarcia ), it might be nice to at least think about adding an action that would get rid of the need to have pep8 speaks on and that would occur behind the scenes for the developer. In addition it will eventually make code review easier once it has been applied to the whole code base.

In addition some pep8 speaks error codes are a little hard to parse (at least for me) and fine, which just leads to a bunch of pep8 or pep8 compliance commits which could all be solved with one GH action making the pep8 fixes automatically.

Describe the solution you'd like
I think the easiest would be to add a pre-commit so that the code is autoformatted to the desired pep8 specifications (even if its not black-ified). I know ruff gives some nice flexibility in picking what to enforce (and in general is also pretty compatible with black-ified code).

Describe alternatives you've considered
Pep8 speaks could be shut off and it could go back to the wild west of submitting code as is.

Additional context
NA

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions