Skip to content

Commit 8c6131e

Browse files
committed
chore: document usage with pre-commit
1 parent da5d1e7 commit 8c6131e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.rst

+18
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,24 @@ following conditions is met:
104104
* The average complexity (among all of the analyzed blocks) is ranked with
105105
``B`` or higher.
106106

107+
Pre-commit hook
108+
+++++++++++++++
109+
110+
Xenon can be used in combination with `pre-commit <https://pre-commit.com/>`_ as follows:
111+
112+
.. code-block:: yaml
113+
114+
# monitor code complexity
115+
- repo: https://github.com/rubik/xenon
116+
rev: v0.9.0
117+
hooks:
118+
- id: xenon
119+
args: ['--max-absolute=B', '--max-modules=B', '--max-average=A']
120+
121+
Note: due to how options are passed to commands by pre-commit, make sure to
122+
pass values either with an equals sign like in the above example, or by
123+
splitting them as separate list items, e.g. ``['--max-absolute', 'B']``.
124+
107125
Other resources
108126
---------------
109127

0 commit comments

Comments
 (0)