@@ -32,36 +32,40 @@ expressions can match multiple lines and include newlines.
3232You can narrow down the file types your linter should be working with, by
3333providing the optional ``filePattern `` attribute. The default is ``.* ``.
3434
35- The optional `error ` attribute allows you to only show a warning but not exit
36- with a bad (non-zero) exit code. The default is `true `.
35+ The optional `` error ` ` attribute allows you to only show a warning but not exit
36+ with a bad (non-zero) exit code. The default is `` true ` `.
3737
3838The following command will lint all files in the current directory:
3939
4040.. code-block :: bash
4141
4242 relint -c .relint.yml **
4343
44- The default configuration file name is `.relint.yml ` within your working
44+ The default configuration file name is `` .relint.yml ` ` within your working
4545directory, but you can provide any YAML or JSON file.
4646
4747If you prefer linting changed files (cached on git) you can use the option
48- `--diff [-d] `:
48+ `` --diff [-d] `` or `` --git-diff [-g] ` `:
4949
5050.. code-block :: bash
5151
5252 git diff --unified=0 | relint my_file.py --diff
5353
54- This option is useful for pre-commit purposes. Here an example of how to use it
54+
55+ pre-commit
56+ ^^^^^^^^^^
57+
58+ You can automate the linting process by adding a **pre-commit ** hook to your
59+ project. Add the following entry to your ``.pre-commit-config.yaml ``:
5560with `pre-commit `_ framework:
5661
5762.. code-block :: yaml
5863
5964 - repo : https://github.com/codingjoe/relint
60- rev : 1.2 .0
65+ rev : 1.4 .0
6166 hooks :
6267 - id : relint
63-
64- You can find an example of `relint-pre-commit.sh `_ in this repository.
68+ args : [-W] # optional, if you want to fail on warnings during commit
6569
6670 Samples
6771-------
@@ -80,7 +84,7 @@ Samples
8084
8185 - name : the database is lava
8286 pattern : ' @pytest.fixture.*\n[ ]*def [^(]+\([^)]*(db|transactional_db)(, |\))'
83- hint : Please do not create db fixtures but model_bakery recipies instead.
87+ hint : Please do not create db fixtures but model_bakery recipes instead.
8488 filePattern : .*\.py
8589
8690 - name : No logger in management commands
0 commit comments