8000 STY: Document line change bump to 88 char · matplotlib/matplotlib@2061607 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2061607

Browse files
ksundentacaswell
authored andcommitted
STY: Document line change bump to 88 char
1 parent 9ab92cd commit 2061607

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Maximum line length increased to 88 characters
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The maximum line length for new contributions has been extended from 79 characters to
5+
88 characters.
6+
This change provides an extra 9 characters to allow code which is a single idea to fit
7+
on fewer lines (often a single line).
8+
Other line lengths considered included 115 and 99, but ultimately 88 characters was the
9+
consensus as it is relatively conservative while still providing reasonable benefit.
10+
The ability to view side-by-side git diffs was a key point in choosing the smaller
11+
limit.
12+
Additionally, it is easier to increase the line length again than to decrease it if it
13+
was found too large.
14+
The chosen length is the same as `black <https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length>`_.
15+
Their justifications influenced the discussion and provided a standard value.

doc/devel/coding_guide.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ rules before submitting a pull request:
3030
for more details.
3131

3232
* Formatting should follow the recommendations of PEP8_, as enforced by
33-
flake8_. You can check flake8 compliance from the command line with ::
33+
flake8_. Matplotlib modifies PEP8 to extend the maximum line length to 88
34+
characters. You can check flake8 compliance from the command line with ::
3435

3536
python -m pip install flake8
3637
flake8 /path/to/module.py
@@ -156,6 +157,12 @@ Content topics:
156157
* Does the PR conform with the :ref:`coding_guidelines`?
157158
* Is the :ref:`documentation <pr-documentation>` (docstrings, examples,
158159
what's new, API changes) updated?
160+
* Is the change only reflowing code/docstrings for increased line length?
161+
Generally, such changes are discouraged when not part of other non-stylistic
162+
work because it obscures the git history of functional changes to the code.
163+
Reflowing a method or docstring as part of a larger refactor/rewrite is
164+
acceptable.
165+
159166

160167
Organizational topics:
161168

0 commit comments

Comments
 (0)
0