-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
STY: make allowed line length 9 longer to 88 from 79 #24893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[flake8] | ||
max-line-length = 79 | ||
max-line-length = 88 | ||
select = | ||
# flake8 default | ||
C90, E, F, W, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Maximum line length increased to 88 characters | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The maximum line length for new contributions has been extended from 79 characters to | ||
88 characters. | ||
This change provides an extra 9 characters to allow code which is a single idea to fit | ||
on fewer lines (often a single line). | ||
Other line lengths considered included 115 and 99, but ultimately 88 characters was the | ||
consensus as it is relatively conservative while still providing reasonable benefit. | ||
The ability to view side-by-side git diffs was a key point in choosing the smaller | ||
limit. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On a more serious note, I wonder about putting too much of our back and forth in the API note. Maybe just say we chose 88, its consistent with black, but we may relax further if there is a good reason... |
||
Additionally, it is easier to increase the line length again than to decrease it if it | ||
was found too large. | ||
The chosen length is the same as `black <https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length>`_. | ||
Their justifications influenced the discussion and provided a standard value. |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -30,7 +30,8 @@ rules before submitting a pull request: | |||||||||||||||||||||||||||||||||||||
for more details. | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
* Formatting should follow the recommendations of PEP8_, as enforced by | ||||||||||||||||||||||||||||||||||||||
flake8_. You can check flake8 compliance from the command line with :: | ||||||||||||||||||||||||||||||||||||||
flake8_. Matplotlib modifies PEP8 to extend the maximum line length to 88 | ||||||||||||||||||||||||||||||||||||||
characters. You can check flake8 compliance from the command line with :: | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
python -m pip install flake8 | ||||||||||||||||||||||||||||||||||||||
flake8 /path/to/module.py | ||||||||||||||||||||||||||||||||||||||
|
@@ -156,6 +157,12 @@ Content topics: | |||||||||||||||||||||||||||||||||||||
* Does the PR conform with the :ref:`coding_guidelines`? | ||||||||||||||||||||||||||||||||||||||
* Is the :ref:`documentation <pr-documentation>` (docstrings, examples, | ||||||||||||||||||||||||||||||||||||||
what's new, API changes) updated? | ||||||||||||||||||||||||||||||||||||||
* Is the change only reflowing code/docstrings for increased line length? | ||||||||||||||||||||||||||||||||||||||
Generally, such changes are discouraged when not part of other non-stylistic | ||||||||||||||||||||||||||||||||||||||
work because it obscures the git history of functional changes to the code. | ||||||||||||||||||||||||||||||||||||||
Reflowing a method or docstring as part of a larger refactor/rewrite is | ||||||||||||||||||||||||||||||||||||||
acceptable. | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seemed a little out of left-field - maybe more general is better?
Suggested change
Suggested change
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
Organizational topics: | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the wrapping here is somehow trying to tell me something ;-)