@@ -7,7 +7,14 @@ An overview on contributing to the _Black_ project.
7
7
Development on the latest version of Python is preferred. You can use any operating
8
8
system.
9
9
10
- Install development dependencies inside a virtual environment of your choice, for
10
+ First clone the _ Black_ repository:
11
+
12
+ ``` console
13
+ $ git clone https://github.com/psf/black.git
14
+ $ cd black
15
+ ```
16
+
17
+ Then install development dependencies inside a virtual environment of your choice, for
11
18
example:
12
19
13
20
``` console
@@ -48,13 +55,16 @@ Further examples of invoking the tests
48
55
# Run tests on a specific python version
49
56
(.venv)$ tox -e py39
50
57
51
- # pass arguments to pytest
58
+ # Run an individual test
59
+ (.venv)$ pytest -k <test name>
60
+
61
+ # Pass arguments to pytest
52
62
(.venv)$ tox -e py -- --no-cov
53
63
54
- # print full tree diff, see documentation below
64
+ # Print full tree diff, see documentation below
55
65
(.venv)$ tox -e py -- --print-full-tree
56
66
57
- # disable diff printing, see documentation below
67
+ # Disable diff printing, see documentation below
58
68
(.venv)$ tox -e py -- --print-tree-diff=False
59
69
```
60
70
@@ -99,42 +109,48 @@ default. To turn it off pass `--print-tree-diff=False`.
99
109
` Black ` has CI that will check for an entry corresponding to your PR in ` CHANGES.md ` . If
100
110
you feel this PR does not require a changelog entry please state that in a comment and a
101
111
maintainer can add a ` skip news ` label to make the CI pass. Otherwise, please ensure you
102
- have a line in the following format:
112
+ have a line in the following format added below the appropriate header :
103
113
104
114
``` md
105
115
- `Black` is now more awesome (#X)
106
116
```
107
117
118
+ <!-- -
119
+ The Next PR Number link uses HTML because of a bug in MyST-Parser that double-escapes the ampersand, causing the query parameters to not be processed.
120
+ MyST-Parser issue: https://github.com/executablebooks/MyST-Parser/issues/760
121
+ MyST-Parser stalled fix PR: https://github.com/executablebooks/MyST-Parser/pull/929
122
+ -->
123
+
108
124
Note that X should be your PR number, not issue number! To workout X, please use
109
- [ Next PR Number ] ( https://ichard26.github.io/next-pr-number/?owner=psf&name=black ) . This
110
- is not perfect but saves a lot of release overhead as now the releaser does not need to
111
- go back and workout what to add to the ` CHANGES.md ` for each release.
125
+ < a href = " https://ichard26.github.io/next-pr-number/?owner=psf&name=black " >Next PR
126
+ Number</ a >. This is not perfect but saves a lot of release overhead as now the releaser
127
+ does not need to go back and workout what to add to the ` CHANGES.md ` for each release.
112
128
113
129
### Style Changes
114
130
115
131
If a change would affect the advertised code style, please modify the documentation (The
116
132
_ Black_ code style) to reflect that change. Patches that fix unintended bugs in
117
133
formatting don't need to be mentioned separately though. If the change is implemented
118
134
with the ` --preview ` flag, please include the change in the future style document
119
- instead and write the changelog entry under a dedicated "Preview changes " heading.
135
+ instead and write the changelog entry under the dedicated "Preview style " heading.
120
136
121
137
### Docs Testing
122
138
123
139
If you make changes to docs, you can test they still build locally too.
124
140
125
141
``` console
126
142
(.venv)$ pip install -r docs/requirements.txt
127
- (.venv)$ pip install -e .[d]
143
+ (.venv)$ pip install -e " .[d]"
128
144
(.venv)$ sphinx-build -a -b html -W docs/ docs/_build/
129
145
```
130
146
131
147
## Hygiene
132
148
133
149
If you're fixing a bug, add a test. Run it first to confirm it fails, then fix the bug,
134
- run it again to confirm it's really fixed.
150
+ and run the test again to confirm it's really fixed.
135
151
136
- If adding a new feature, add a test. In fact, always add a test. But wait, before adding
137
- any large feature, first open an issue for us to discuss the idea first .
152
+ If adding a new feature, add a test. In fact, always add a test. If adding a large
153
+ feature, please first open an issue to discuss it beforehand .
138
154
139
155
## Finally
140
156
0 commit comments