Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
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
- 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
If done in a single commit then the commit can be saved in
git-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-blameWe 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