A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/matplotlib/matplotlib/issues/18796 below:

Consider using black as an autoformatter · Issue #18796 · matplotlib/matplotlib · GitHub

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 using black. This would remove the mental burden of formatting by having contributors only need to run:

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 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-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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4