Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Consider using black as an autoformatter #18796

Closed
@ianhi

Description

@ianhi

Problem

I find flake8 errors to be confusing to fix at times. For example, I've expended more mental energy than I care to admit trying to figure out how to turn an 81 character line into two lines. This feels like it makes more difficult to contribute to matplotlib, especially for someone who hasn't gone to the trouble of setting up an ide to point out flake8 errors. More difficult both through the extra mental effort and the extra back and forth about formatting on PRs.

Proposed Solution

Autoformat all code usingblack. This would remove the mental burden of formatting by having contributors only need to run:

black .

Additional context and prior art

  1. Plunging the depths for flake8 commits: (those that never got squashed)

git log --all | grep "flake" -c -i
169

git log --all | grep "fix.*format" -c -i
259

  1. If done in a single commit then the commit can be saved ingit-blame-ignore-revs to avoid messing up git blame (though I suppose it may be messed up on github :/ )
    https://black.readthedocs.io/en/stable/installation_and_usage.html#migrating-your-code-style-without-ruining-git-blame

  2. We did this on jupyterlab-git (Format code using black jupyterlab/jupyterlab-git#763) and it has sparked me trying to use this everywhere I can

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp