Ran
|
Files
11
|
Run time
3s
|
Badge
Embed ▾
README BADGES
|
push
travis-ci
<a href="https://github.com/psf/black/commit/<a class=hub.com/psf/black/commit/<a class="double-link" href="https://git"><a class=hub.com/psf/black/commit/d62d677ca2135714d6159f6b4839983fb0a557c8">d62d677ca"><a href="https://github.com/psf/black/commit/</a><a class="double-link" href="https://github.com/psf/black/commit/d62d677ca2135714d6159f6b4839983fb0a557c8">d62d677ca</a><a href="https://github.com/psf/black/commit/d62d677ca2135714d6159f6b4839983fb0a557c8">">Recommend B950 + 88 char limit instead of 80 (#2050) [The section about line length][1] was contradictory. On one side, it said: &gt; Black will try to respect that [line length limit]. However, sometimes it won&#39;t be able to without breaking other rules. In those rare cases, auto-formatted code will exceed your allotted limit. So black doesn&#39;t guarantee that your code is formatted at 88 chars, even when configured with `--line-length=88` (default). Black uses this limit as a &quot;hint&quot; more than a &quot;rule&quot;. OTOH, it also said: &gt; If you&#39;re using Flake8, you can bump max-line-length to 88 and forget about it. Alternatively, use Bugbear&#39;s B950 warning instead of E501 and keep the max line length at 80 which you are probably already using. But that&#39;s not true. You can&#39;t &quot;forget about it&quot; because Black sometimes won&#39;t respect the limit. Both E501 at 88 and B950 at 80 behave the same: linter error at 89+ length. So, if Black happens to decide that a line of code is better at 90 characters that some other fancy style, you land on a unlucky situation where both tools will fight. So, AFAICS, the best way to align flake8 and black is to: 1. Use flake8-bugbear 2. Enable B950 3. Disable E501 4. Set `max-line-length = 88` This way, we also tell flake8 that 88 limit is a &quot;hint&quot; and not a &quot;rule&quot;. The real rule will be 88 + 10%. If black decides that a line fits better in 97 characters than in 88 + some formatting, _that_ probably mea... (continued)
4757 of 4992 relevant lines covered (95.29%)
0.95 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|