@@ -45,6 +45,9 @@ More details on using ``unittest`` are `here
45
45
Code quality checks
46
46
^^^^^^^^^^^^^^^^^^^
47
47
48
+ tl;dr: Run ``pre-commit install --overwrite `` to perform checks when committing, and
49
+ ``./scripts/test `` to run the tests.
50
+
48
51
PySTAC uses
49
52
50
53
- `black <https://github.com/psf/black >`_ for Python code formatting
@@ -53,13 +56,18 @@ PySTAC uses
53
56
- `flake8 <http://flake8.pycqa.org/en/latest/ >`_ for Python style checks
54
57
- `mypy <http://www.mypy-lang.org/ >`_ for Python type annotation checks
55
58
56
- To run all of these:
57
-
58
- .. code-block :: bash
59
+ Run all of these with `` pre-commit run --all-files `` or a single one using
60
+ `` pre-commit run --all-files ID ``, where `` ID `` is one of the command names above. For
61
+ example, to format all the Python code, run `` pre-commit run --all-files black ``.
59
62
60
- > pre-commit run --all-files
63
+ You can also install a Git pre-commit hook which will run the relevant linters and
64
+ formatters on any staged code when committing. This will be much faster than running on
65
+ all files, which is usually[#]_ only required when changing the pre-commit version or
66
+ configuration. Once installed you can bypass this check by adding the ``--no-verify ``
67
+ flag to Git commit commands, as in ``git commit --no-verify ``.
61
68
62
- You can also run ``./scripts/test `` to run the tests.
69
+ .. [# ] In rare cases changes to one file might invalidate an unchanged file, such as
70
+ when modifying the return type of a function used in another file.
63
71
64
72
CHANGELOG
65
73
^^^^^^^^^
0 commit comments