You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: package-structure-code/code-style-linting-format.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
* pyOpenSci requires authors to follow PEP 8 code format guidelines
8
8
* Setting up a code formatters like Black and isort will help you enforce PEP 8 style guidelines and also consistent, readable code format
9
-
* Some commonly used tools are: Black/Blue, Isort, flake8, ruff
9
+
* Some commonly used tools are: Black, Isort, flake8, Ruff
10
10
* You can also setup pre-commit hooks which will run code formatters locally
11
11
each time you make a commit.
12
12
* [precommit.ci](https://pre-commit.ci/) is a bot that you can add to your GitHub repository. It will automagically apply code format to every PR using the tools specified in your pre-commit-config.yaml file. It can save significant time and make contributions easier for new contributors.
@@ -86,15 +86,15 @@ You will learn more about Black below.
86
86
87
87
### Black and Blue
88
88
89
-
[Black](https://black.readthedocs.io/en/stable/)and [Blue](https://blue.readthedocs.io/en/latest/) (which wraps around Black) are code
90
-
formatters. Both Black and Blue will automagically (and _unapologetically_)
89
+
[Black](https://black.readthedocs.io/en/stable/)is a code
90
+
formatter. Black will automagically (and _unapologetically_)
91
91
fix spacing issues and ensure code format is consistent throughout your
92
-
package. Black and Blue also generally adhere to PEP 8 style guidelines with
92
+
package. Black also generally adhere to PEP 8 style guidelines with
93
93
some exceptions. A few examples of those exceptions are below:
94
94
95
95
- Black defaults to a line length of 88 (79 + 10%) rather than the 79 character `PEP 8` specification. However, line length is a setting can be manually overwritten in your Black configuration.
96
-
- Black and Blue will not adjust line length in your comments or docstrings.
97
-
-Neither tool will review and fix import order (you need _isort_ or _Ruff_ to do that - see below).
96
+
- Black will not adjust line length in your comments or docstrings.
97
+
-This tool will not review and fix import order (you need _isort_ or _Ruff_ to do that - see below).
98
98
99
99
Blue addresses a few format decisions in Black that some maintainers do not like.
100
100
[You can compare the differences here](https://blue.readthedocs.io/en/latest/#so-what-s-different) and decide which tool you prefer!
@@ -104,7 +104,7 @@ If you are interested in seeing how Black will format your code, you can
104
104
use the [Black playground](https://black.vercel.app/)
105
105
```
106
106
107
-
Using a code formatter like Black or Blue will leave you more time to work on
107
+
Using a code formatter like Black will leave you more time to work on
108
108
code function rather than worry about format.
109
109
110
110
### flake8 for linting code in Python packages
@@ -225,7 +225,7 @@ select = [
225
225
"I", # isort
226
226
]
227
227
ignore = [
228
-
"E501", # line >79, handled by black/blue
228
+
"E501", # line >79, handled by black
229
229
]
230
230
```
231
231
@@ -411,7 +411,7 @@ pyOpenSci suggests setting up a linter and a code styler for
411
411
your package, regardless of whether you use pre-commit hooks, CI
412
412
or other infrastructure to manage code format. Setting up these
413
413
tools will give you automatic feedback about your code's
414
-
structure as you (or a contributor) write it. And using tools
415
-
like black or blue that format code for you, reduce effort that
414
+
structure as you (or a contributor) write it. And using a tool
415
+
like black that format code for you, reduce effort that
416
416
you need to make surrounding decisions around code format and
0 commit comments