Skip to content

Commit 745eac8

Browse files
authored
Update contribution guidelines and added default python version for pre-commit (#688)
1 parent 2ba4e5f commit 745eac8

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

.pre-commit-config.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
fail_fast: true
22
default_install_hook_types: [pre-commit, pre-push]
3+
default_language_version:
4+
python: python3.12
35

46
ci:
57
skip:
@@ -29,7 +31,7 @@ repos:
2931
- id: black
3032

3133
- repo: https://github.com/astral-sh/ruff-pre-commit
32-
rev: v0.9.6
34+
rev: v0.9.9
3335
hooks:
3436
- id: ruff
3537
args: ["--fix"]
@@ -40,7 +42,7 @@ repos:
4042
- id: yesqa
4143

4244
- repo: https://github.com/crate-ci/typos
43-
rev: v1.29.5
45+
rev: v1.30.1
4446
hooks:
4547
- id: typos
4648
args: []

CONTRIBUTING.rst

+15-7
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,18 @@ is done as follows:
5959
6060
.. note::
6161

62-
The ``.pre-commit-config.yaml`` file was changed such that some hooks are
63-
now run on ``pre-push``. If you have an old development environment, please
64-
run ``pre-commit install`` again to update the git hooks.
62+
``.pre-commit-config.yaml`` is configured to run the hooks using python
63+
3.12. Thus, you need to have python 3.12 installed for pre-commit to work.
6564

6665
The ``pre-push`` stage runs several hooks (tests, doctests, mypy, coverage) that
67-
take some time. These are intended to let developers know problems which must be
68-
resolved for any pull request to be considered for merging. If you wish to push
69-
without running these hooks, use the command ``git push --no-verify``.
66+
take some time. These hooks are intended to inform developers of issues that
67+
must be resolved before any pull request can be considered for merging. If you
68+
wish to push without running these hooks, use the command ``git push
69+
--no-verify``.
70+
71+
Formatting of the code is done automatically by pre-commit. If some pre-commit
72+
hooks fail and you decide to skip them, the formatting will be automatically
73+
applied by a github action in pull requests.
7074

7175
Documentation
7276
-------------
@@ -86,7 +90,8 @@ Tests
8690
Running the unit tests can be done either using using `pytest
8791
<https://docs.pytest.org/>`__ or `tox
8892
<https://tox.readthedocs.io/en/stable/>`__. The tests are also installed with
89-
the package, thus can be run in a production system.
93+
the package, thus can be run in a production system. Also pre-commit runs some
94+
additional tests.
9095

9196
.. code-block:: bash
9297
@@ -96,6 +101,9 @@ the package, thus can be run in a production system.
96101
python -m jsonargparse_tests # Run tests on installed package (requires pytest and pytest-subtests)
97102
pre-commit run -a --hook-stage pre-push # Run pre-push git hooks (tests, doctests, mypy, coverage)
98103
104+
Coverage
105+
--------
106+
99107
For a nice html test coverage report, run:
100108

101109
.. code-block:: bash

0 commit comments

Comments
 (0)