Skip to content

Commit 379f63a

Browse files
authored
Explain in CONTRIBUTING.md about using --apply with format-incremental (#1301)
The `CONTRIBUTING.md` file explained the use of `check/format-incremental`, but didn't mention the use of the `--apply` flag to auto-fix format problems. This PR fixes that.
1 parent 528ae23 commit 379f63a

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

CONTRIBUTING.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,21 @@ make Mypy run in parallel for a substantial speed increase.
249249
250250
Code should meet common style standards for Python and be free of error-prone constructs. We use
251251
[Pylint](https://www.pylint.org/) to check for code lint and [Black](https://github.com/psf/black)
252-
for formatting code.
252+
for formatting code, and provide scripts to run them.
253253
254254
* To check that code is formatted properly after editing Python files:
255255
256256
```shell
257257
check/format-incremental
258258
```
259259
260+
If formatting issues are reported, you can fix them automatically by running the script with
261+
the `--apply` option:
262+
263+
```shell
264+
check/format-incremental --apply
265+
```
266+
260267
* To run the linter:
261268
262269
```shell
@@ -289,8 +296,8 @@ We use [pytest](https://docs.pytest.org) to run our tests and
289296
`pytest -m "not slow" PATH`, where `PATH` is a directory or pytest file to test.
290297
291298
* After finishing a task, run `check/pytest` to test all of the OpenFermion code. If your system
292-
has multiple processor cores, you can add the option `-n auto` to make it run in parallel for a
293-
substantial speed increase. (Beware, though, that this is resource-intensive.)
299+
has multiple processor cores, you can add the option `-n auto` to make pytest use multiple
300+
parallel processes for a speed increase. (Beware, though, that this is resource-intensive.)
294301
295302
We don't require 100% coverage, but coverage should be very high, and any uncovered code must be
296303
annotated with `# pragma: no cover`. To ignore coverage of a single line, place `# pragma: no cover`
@@ -301,7 +308,7 @@ cover` comment on its own line. Note, however, that these annotations should be
301308

302309
After a task is finished, run each of the following to make sure everything passes all the tests:
303310

304-
* `check/format-incremental`
311+
* `check/format-incremental` (and `check/format-incremental --apply` to auto-fix format problems)
305312
* `check/pylint -j 0`
306313
* `check/mypy`
307314
* `check/pytest -n auto`

0 commit comments

Comments
 (0)