Skip to content

Make Black in CI more user friendly #1002

@PGijsbers

Description

@PGijsbers

When files are uploaded which are not Black-formatted, CI gives a less than helpful message about what is wrong. We'll have to look into what is possible, but I would consider the following alternatives:

  • Have a bot which lists the Black changes, and you can interact with to have it commit those changes for you (either to identify a bot we want to adopt, or to create one)
  • Apply Black formatting if needed and re-commit automatically (is that desirable? By seeing the feedback, at times I get ideas for further refactoring)
  • Show the changes in the CI log (maybe there is a Black option, otherwise an added git diff should suffice)

The main use case is to make edits through the web interface smoother. E.g. I had set up this pr through the web to keep it quick, but ended up pulling my branch anyway to see what changes I was required to make to pass pre-commit. It also helps users which have incorrectly configured their pre-commit (we could also have the bot point that out).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions