@@ -7,7 +7,14 @@ An overview on contributing to the _Black_ project.
77Development on the latest version of Python is preferred. You can use any operating
88system.
99
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
1118example:
1219
1320``` console
@@ -48,13 +55,16 @@ Further examples of invoking the tests
4855# Run tests on a specific python version
4956(.venv)$ tox -e py39
5057
51- # pass arguments to pytest
58+ # Run an individual test
59+ (.venv)$ pytest -k <test name>
60+
61+ # Pass arguments to pytest
5262(.venv)$ tox -e py -- --no-cov
5363
54- # print full tree diff, see documentation below
64+ # Print full tree diff, see documentation below
5565(.venv)$ tox -e py -- --print-full-tree
5666
57- # disable diff printing, see documentation below
67+ # Disable diff printing, see documentation below
5868(.venv)$ tox -e py -- --print-tree-diff=False
5969```
6070
@@ -99,42 +109,48 @@ default. To turn it off pass `--print-tree-diff=False`.
99109` Black ` has CI that will check for an entry corresponding to your PR in ` CHANGES.md ` . If
100110you feel this PR does not require a changelog entry please state that in a comment and a
101111maintainer 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 :
103113
104114``` md
105115- `Black` is now more awesome (#X)
106116```
107117
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+
108124Note 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.
112128
113129### Style Changes
114130
115131If a change would affect the advertised code style, please modify the documentation (The
116132_ Black_ code style) to reflect that change. Patches that fix unintended bugs in
117133formatting don't need to be mentioned separately though. If the change is implemented
118134with 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.
120136
121137### Docs Testing
122138
123139If you make changes to docs, you can test they still build locally too.
124140
125141``` console
126142(.venv)$ pip install -r docs/requirements.txt
127- (.venv)$ pip install -e .[d]
143+ (.venv)$ pip install -e " .[d]"
128144(.venv)$ sphinx-build -a -b html -W docs/ docs/_build/
129145```
130146
131147## Hygiene
132148
133149If 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.
135151
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 .
138154
139155## Finally
140156
0 commit comments