Skip to content

Commit 52780e3

Browse files
committed
Reflow CONTRIBUTING.md
1 parent d01190c commit 52780e3

File tree

1 file changed

+92
-98
lines changed

1 file changed

+92
-98
lines changed

CONTRIBUTING.md

+92-98
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ Start by forking the repo and cloning locally:
3737
$ git clone https://github.com/{you}/sphobjinv
3838
```
3939

40-
Then, create a virtual environment for the project,
41-
in whatever location you prefer. Any Python interpreter 3.6+ *should* work fine.
40+
Then, create a virtual environment for the project, in whatever location you
41+
prefer. Any Python interpreter 3.6+ *should* work fine.
4242

4343
I prefer to use `virtualenv` and create in `./env`:
4444

@@ -80,20 +80,20 @@ as some of the tests interact with them:
8080

8181
## Working with git
8282

83-
There's no way I can fit a whole git tutorial in here, so this
84-
just highlights a couple of key functionalities you'll need.
83+
There's no way I can fit a whole git tutorial in here, so this just highlights a
84+
couple of key functionalities you'll need.
8585

8686
First, always hack on a bugfix or feature in a new branch:
8787

8888
```
8989
$ git checkout -b description-of-change
9090
```
9191

92-
This makes it a lot simpler to get your repo fork up to date
93-
after `main` receives further commits.
92+
This makes it a lot simpler to get your repo fork up to date after `main`
93+
receives further commits.
9494

95-
To bring your fork's `main` up to date, you first need to
96-
add the main repo as a new git remote (one-time task):
95+
To bring your fork's `main` up to date, you first need to add the main repo as a
96+
new git remote (one-time task):
9797

9898
```
9999
$ git remote add upstream https://github.com/bskinn/sphobjinv
@@ -111,47 +111,44 @@ $ git push # (should push to your fork without incident)
111111

112112
## Tests
113113

114-
`sphobjinv` uses the [`pytest`](https://github.com/pytest-dev/pytest)
115-
framework for most of its automated tests. From a properly configured
116-
virtual environment, a simple no-arguments invocation is all
117-
that is required:
114+
`sphobjinv` uses the [`pytest`](https://github.com/pytest-dev/pytest) framework
115+
for most of its automated tests. From a properly configured virtual environment,
116+
a simple no-arguments invocation is all that is required:
118117

119118
```
120119
$ pytest
121120
```
122121

123-
The test suite defaults to running only local tests,
124-
those that do **NOT** require network access. To include
125-
the nonlocal tests, run with the `--nonloc` flag:
122+
The test suite defaults to running only local tests, those that do **NOT**
123+
require network access. To include the nonlocal tests, run with the `--nonloc`
124+
flag:
126125

127126
```
128127
$ pytest --nonloc
129128
```
130129

131-
When putting together a PR, at minimum, please add/augment the test suite
132-
as necessary to maintain 100% test coverage. To the extent possible,
133-
please go beyond this and add tests that check potential edge cases,
134-
bad/malformed/invalid inputs, etc. For bugfixes, add one or more
135-
focused regression tests that cover the bug behavior being fixed.
130+
When putting together a PR, at minimum, please add/augment the test suite as
131+
necessary to maintain 100% test coverage. To the extent possible, please go
132+
beyond this and add tests that check potential edge cases, bad/malformed/invalid
133+
inputs, etc. For bugfixes, add one or more focused regression tests that cover
134+
the bug behavior being fixed.
136135

137-
PRs that add [xfail tests for existing bugs](https://blog.ganssle.io/articles/2021/11/pytest-xfail.html)
136+
PRs that add
137+
[xfail tests for existing bugs](https://blog.ganssle.io/articles/2021/11/pytest-xfail.html)
138138
are also welcomed.
139139

140-
There are some situations where it may make sense to use a
141-
`# pragma: no cover` to ignore coverage on certain line(s) of code.
142-
Please start a discussion in the issue or PR comments before
143-
adding such a pragma.
140+
There are some situations where it may make sense to use a `# pragma: no cover`
141+
to ignore coverage on certain line(s) of code. Please start a discussion in the
142+
issue or PR comments before adding such a pragma.
144143

145-
Note that while [`tox`](https://github.com/tox-dev/tox/) *is*
146-
configured for the project, it is **not** set up to be an everyday test runner.
147-
Instead, it's used to execute a matrix of test environments
148-
checking for the compatibility of different Python and dependency
149-
versions. You can run it if you want, but you'll need
150-
working versions of all of Python 3.6 through 3.11
151-
installed and on `PATH` as `python3.6`, `python3.7`, etc.
152-
The nonlocal test suite is run for each `tox` environment, so
153-
it's best to use at most two parallel sub-processes to avoid oversaturating
154-
your network bandwidth; e.g.:
144+
Note that while [`tox`](https://github.com/tox-dev/tox/) *is* configured for the
145+
project, it is **not** set up to be an everyday test runner. Instead, it's used
146+
to execute a matrix of test environments checking for the compatibility of
147+
different Python and dependency versions. You can run it if you want, but you'll
148+
need working versions of all of Python 3.6 through 3.11 installed and on `PATH`
149+
as `python3.6`, `python3.7`, etc. The nonlocal test suite is run for each `tox`
150+
environment, so it's best to use at most two parallel sub-processes to avoid
151+
oversaturating your network bandwidth; e.g.:
155152

156153
```
157154
$ tox -rp2
@@ -161,24 +158,24 @@ $ tox -rp2
161158
## Linting
162159

163160
The project uses a number of lints, which are checked using
164-
[`flake8`](https://gitlab.com/pycqa/flake8) in CI.
165-
To run the lints locally, it's easiest to use `tox`:
161+
[`flake8`](https://gitlab.com/pycqa/flake8) in CI. To run the lints locally,
162+
it's easiest to use `tox`:
166163

167164
```
168165
$ tox -e flake8
169166
```
170167

171168
In some limited circumstances, it may be necessary to add
172169
[`# noqa`](https://flake8.pycqa.org/en/stable/user/violations.html#in-line-ignoring-errors)
173-
or [`per_file_ignores`](https://flake8.pycqa.org/en/stable/user/options.html#cmdoption-flake8-per-file-ignores)
174-
exclusions to the `flake8` lints.
175-
Please note these for discussion in an issue/PR comment
176-
as soon as you think they might be needed.
170+
or
171+
[`per_file_ignores`](https://flake8.pycqa.org/en/stable/user/options.html#cmdoption-flake8-per-file-ignores)
172+
exclusions to the `flake8` lints. Please note these for discussion in an
173+
issue/PR comment as soon as you think they might be needed.
177174

178-
Additionally, the CI for pull requests is set up to check that all
179-
modules, functions, classes and methods have docstrings
180-
using the [`interrogate`](https://pypi.org/project/interrogate/) package.
181-
There's a `tox` environment for running this check, also:
175+
Additionally, the CI for pull requests is set up to check that all modules,
176+
functions, classes and methods have docstrings using the
177+
[`interrogate`](https://pypi.org/project/interrogate/) package. There's a `tox`
178+
environment for running this check, also:
182179

183180
```
184181
$ tox -e interrogate
@@ -187,36 +184,33 @@ $ tox -e interrogate
187184

188185
## Type Hints
189186

190-
I'd like to [roll out typing](https://github.com/bskinn/sphobjinv/issues/132)
191-
on the project at some point in the near future, and add
192-
[`mypy`](https://github.com/python/mypy) checking to CI.
193-
(This would be a great PR to put together, for anyone interested....)
194-
For now, types on contributed code are welcomed, but optional.
195-
Once the codebase is typed, though, they will be a required part of
196-
any PR touching code.
187+
I'd like to [roll out typing](https://github.com/bskinn/sphobjinv/issues/132) on
188+
the project at some point in the near future, and add
189+
[`mypy`](https://github.com/python/mypy) checking to CI. (This would be a great
190+
PR to put together, for anyone interested....) For now, types on contributed
191+
code are welcomed, but optional. Once the codebase is typed, though, they will
192+
be a required part of any PR touching code.
197193

198194

199195
## Documentation
200196

201-
All of the project documentation (except the README) is
202-
generated via [Sphinx](https://github.com/sphinx-doc/sphinx),
203-
and should be updated for (at minimum) any behavior changes
204-
in the codebase. API changes should be documented in the
205-
relevant docstring(s), and possibly in the prose portions
206-
of the documentation as well. Please use the modified
207-
[NumPy-style](https://numpydoc.readthedocs.io/en/latest/format.html)
208-
formatting for docstrings that is already in use in the project.
197+
All of the project documentation (except the README) is generated via
198+
[Sphinx](https://github.com/sphinx-doc/sphinx), and should be updated for (at
199+
minimum) any behavior changes in the codebase. API changes should be documented
200+
in the relevant docstring(s), and possibly in the prose portions of the
201+
documentation as well. Please use the modified
202+
[NumPy-style](https://numpydoc.readthedocs.io/en/latest/format.html) formatting
203+
for docstrings that is already in use in the project.
209204

210205
A large number of reStructuredText substitutions are defined in the `rst_epilog`
211-
setting within `conf.py`, to make the documentation source
212-
more readable. Feel free to add more entries there.
206+
setting within `conf.py`, to make the documentation source more readable. Feel
207+
free to add more entries there.
213208

214-
To run any of the Sphinx builders, first change to the `/doc` directory
215-
in the repository tree. In most cases, a plain `make html` invocation
216-
is sufficient to build the docs properly,
217-
as Sphinx does its best to detect which files were changed and
218-
rebuild only the minimum portion of the documentation necessary.
219-
If the docs seem not to be rendering correctly, try a clean build:
209+
To run any of the Sphinx builders, first change to the `/doc` directory in the
210+
repository tree. In most cases, a plain `make html` invocation is sufficient to
211+
build the docs properly, as Sphinx does its best to detect which files were
212+
changed and rebuild only the minimum portion of the documentation necessary. If
213+
the docs seem not to be rendering correctly, try a clean build:
220214

221215
```
222216
=== Linux/Mac
@@ -226,10 +220,10 @@ doc $ make clean html
226220
doc> make -Ea
227221
```
228222

229-
It's also a good idea to build the complete docs every once in a while with
230-
its ['nitpicky' option](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-nitpicky),
231-
in order to detect any broken cross-references, as these will fail
232-
the [Azure CI pipeline](#continuous-integration):
223+
It's also a good idea to build the complete docs every once in a while with its
224+
['nitpicky' option](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-nitpicky),
225+
in order to detect any broken cross-references, as these will fail the
226+
[Azure CI pipeline](#continuous-integration):
233227

234228
```
235229
=== Linux/Mac
@@ -239,49 +233,49 @@ doc $ O=-n make clean html
239233
doc> make html -Ean
240234
```
241235

242-
You can also run the doctests with `make doctest`
243-
and the link validity checker with `make linkcheck`.
236+
You can also run the doctests with `make doctest` and the link validity checker
237+
with `make linkcheck`.
244238

245239

246240
## Continuous Integration
247241

248-
Both Github Actions and Azure Pipelines are set up for the project,
249-
and should run on any forks of the repository.
242+
Both Github Actions and Azure Pipelines are set up for the project, and should
243+
run on any forks of the repository.
250244

251-
Github Actions runs the test suite on Linux for Python 3.6 through 3.10,
252-
as well as the `flake8` lints and the Sphinx doctests and link-validity testing,
253-
and is configured to run on all commits. The workflow can be skipped
254-
per-commit by including `[skip ci]` in the commit message.
245+
Github Actions runs the test suite on Linux for Python 3.6 through 3.10, as well
246+
as the `flake8` lints and the Sphinx doctests and link-validity testing, and is
247+
configured to run on all commits. The workflow can be skipped per-commit by
248+
including `[skip ci]` in the commit message.
255249

256250
The Azure Pipelines CI runs an extensive matrix of cross-platform and
257-
cross-Python-version tests, as well as numerous other checks.
258-
Due to its length, it is configured to run only on release branches
259-
and PRs to `main` or `stable`. It cannot be skipped.
251+
cross-Python-version tests, as well as numerous other checks. Due to its length,
252+
it is configured to run only on release branches and PRs to `main` or `stable`.
253+
It cannot be skipped.
260254

261255

262256
## CHANGELOG
263257

264-
The project [`CHANGELOG`](https://github.com/bskinn/sphobjinv/blob/main/CHANGELOG.md)
265-
should be updated for the majority of contributions. No tooling is in place
266-
(e.g., [`towncrier`](https://github.com/twisted/towncrier)) for automated collation
267-
of news items into `CHANGELOG`;
268-
all changes should be documented manually, directly in the `CHANGELOG`.
258+
The project
259+
[`CHANGELOG`](https://github.com/bskinn/sphobjinv/blob/main/CHANGELOG.md) should
260+
be updated for the majority of contributions. No tooling is in place (e.g.,
261+
[`towncrier`](https://github.com/twisted/towncrier)) for automated collation of
262+
news items into `CHANGELOG`; all changes should be documented manually, directly
263+
in the `CHANGELOG`.
269264

270265
Any PR that touches the project code *must* include a `CHANGELOG` entry.
271-
Contributions that make changes just to the test suite should usually also include
272-
a `CHANGELOG` entry, except for very minor or cosmetic changes. Other changes of note
273-
(packaging/build tooling, test/lint tooling/plugins, tool settings, etc.)
274-
may also warrant a `CHANGELOG` bullet, depending on the situation.
275-
When in doubt, ask!
266+
Contributions that make changes just to the test suite should usually also
267+
include a `CHANGELOG` entry, except for very minor or cosmetic changes. Other
268+
changes of note (packaging/build tooling, test/lint tooling/plugins, tool
269+
settings, etc.) may also warrant a `CHANGELOG` bullet, depending on the
270+
situation. When in doubt, ask!
276271

277272

278273
## Issue & PR Templates
279274

280-
The project is configured with a PR template and a couple of
281-
issue templates, to hopefully make it easier to provide all
282-
the information needed to act on code contributions, bug reports,
283-
and feature requests. If the templates don't fit the issue/PR
284-
you want to create, though, then don't use them.
275+
The project is configured with a PR template and a couple of issue templates, to
276+
hopefully make it easier to provide all the information needed to act on code
277+
contributions, bug reports, and feature requests. If the templates don't fit the
278+
issue/PR you want to create, though, then don't use them.
285279

286280

287281
## License

0 commit comments

Comments
 (0)