Skip to content

Commit c472557

Browse files
authored
Small improvements to the contributing basics (psf#4502)
1 parent 53a2190 commit c472557

File tree

2 files changed

+38
-19
lines changed

2 files changed

+38
-19
lines changed

CONTRIBUTING.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# Contributing to _Black_
22

3-
Welcome! Happy to see you willing to make the project better. Have you read the entire
4-
[user documentation](https://black.readthedocs.io/en/latest/) yet?
3+
Welcome future contributor! We're happy to see you willing to make the project better.
54

6-
Our [contributing documentation](https://black.readthedocs.org/en/latest/contributing/)
7-
contains details on all you need to know about contributing to _Black_, the basics to
8-
the internals of _Black_.
5+
If you aren't familiar with _Black_, or are looking for documentation on something
6+
specific, the [user documentation](https://black.readthedocs.io/en/latest/) is the best
7+
place to look.
98

10-
We look forward to your contributions!
9+
For getting started on contributing, please read the
10+
[contributing documentation](https://black.readthedocs.org/en/latest/contributing/) for
11+
all you need to know.
12+
13+
Thank you, and we look forward to your contributions!

docs/contributing/the_basics.md

+29-13
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ An overview on contributing to the _Black_ project.
77
Development on the latest version of Python is preferred. You can use any operating
88
system.
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
1118
example:
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
100110
you feel this PR does not require a changelog entry please state that in a comment and a
101111
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:
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+
108124
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.
112128

113129
### Style Changes
114130

115131
If 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
117133
formatting don't need to be mentioned separately though. If the change is implemented
118134
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.
120136

121137
### Docs Testing
122138

123139
If 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

133149
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.
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

Comments
 (0)