From 9ab92cdc5913e0707e0e304f03887a91a79a50e5 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 5 Jan 2023 19:21:46 -0500 Subject: [PATCH 1/4] STY: make allowed line length 9 longer to 88 from 79 --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index ef1333dbf4c0..490ea57d9891 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ [flake8] -max-line-length = 79 +max-line-length = 88 select = # flake8 default C90, E, F, W, From 2061607f4887362c8b9a614a1b72c3c684fd9aa1 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Wed, 25 Jan 2023 12:53:36 -0600 Subject: [PATCH 2/4] STY: Document line change bump to 88 char --- doc/api/next_api_changes/development/24893-KS.rst | 15 +++++++++++++++ doc/devel/coding_guide.rst | 9 ++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 doc/api/next_api_changes/development/24893-KS.rst diff --git a/doc/api/next_api_changes/development/24893-KS.rst b/doc/api/next_api_changes/development/24893-KS.rst new file mode 100644 index 000000000000..af5ce90d505c --- /dev/null +++ b/doc/api/next_api_changes/development/24893-KS.rst @@ -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. +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 `_. +Their justifications influenced the discussion and provided a standard value. diff --git a/doc/devel/coding_guide.rst b/doc/devel/coding_guide.rst index 3e9788ade101..3c16a5eccdc2 100644 --- a/doc/devel/coding_guide.rst +++ b/doc/devel/coding_guide.rst @@ -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 ` (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. + Organizational topics: From 5d78563e29e92a46858dc2c2612ab33413d8e581 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Wed, 25 Jan 2023 17:29:59 -0600 Subject: [PATCH 3/4] Add superseded note to MEP8 --- doc/devel/MEP/MEP08.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/devel/MEP/MEP08.rst b/doc/devel/MEP/MEP08.rst index 67ce5d3d76ef..18419ac2bf11 100644 --- a/doc/devel/MEP/MEP08.rst +++ b/doc/devel/MEP/MEP08.rst @@ -9,7 +9,10 @@ Status ====== -**Completed** +**Superseded** + +Current guidelines for style, including usage of pep8 are maintained +in `our pull request guidelines `_. We are currently enforcing a sub-set of pep8 on new code contributions. From c898957e0ddf6cf532bb3893dfe7367141bd7397 Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Thu, 26 Jan 2023 13:43:25 -0600 Subject: [PATCH 4/4] Terser statements (from review comments) --- doc/api/next_api_changes/development/24893-KS.rst | 7 ------- doc/devel/coding_guide.rst | 9 ++++----- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/doc/api/next_api_changes/development/24893-KS.rst b/doc/api/next_api_changes/development/24893-KS.rst index af5ce90d505c..382f0c1c5cc1 100644 --- a/doc/api/next_api_changes/development/24893-KS.rst +++ b/doc/api/next_api_changes/development/24893-KS.rst @@ -5,11 +5,4 @@ The maximum line length for new contributions has been extended from 79 characte 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. -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 `_. -Their justifications influenced the discussion and provided a standard value. diff --git a/doc/devel/coding_guide.rst b/doc/devel/coding_guide.rst index 3c16a5eccdc2..d584a1c986e7 100644 --- a/doc/devel/coding_guide.rst +++ b/doc/devel/coding_guide.rst @@ -157,11 +157,10 @@ Content topics: * Does the PR conform with the :ref:`coding_guidelines`? * Is the :ref:`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. +* Is the change purely stylistic? 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. Organizational topics: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy