@@ -20,9 +20,9 @@ You can write your own regular rules in a YAML file, like so:
20
20
.. code-block :: YAML
21
21
22
22
- name : No ToDo
23
- pattern : " [tT][oO][dD][oO]"
23
+ pattern : ' [tT][oO][dD][oO]'
24
24
hint : Get it done right away!
25
- filePatter : " .*\. (py|js)"
25
+ filePattern : .*\.(py|js)
26
26
error : false
27
27
28
28
The ``name `` attribute is the name of your linter, the ``pattern `` can be
@@ -54,7 +54,7 @@ If you prefer linting changed files (cached on git) you can use the option
54
54
This option is useful for pre-commit purposes. Here an example of how to use it
55
55
with `pre-commit `_ framework:
56
56
57
- .. code-block :: YAML
57
+ .. code-block :: yaml
58
58
59
59
- repo : https://github.com/codingjoe/relint
60
60
rev : 1.2.0
@@ -69,24 +69,24 @@ Samples
69
69
.. code-block :: yaml
70
70
71
71
- name : db fixtures
72
- pattern : " def test_[^(]+\\ ([^)]*(customer|product)(, |\\ )) "
72
+ pattern : ' def test_[^(]+\([^)]*(customer|product)(, |\)) '
73
73
hint : Use model_mommy recipies instead of db fixtures.
74
- filePattern : " test_.*\. py"
74
+ filePattern : test_.*\.py
75
75
76
76
- name : model_mommy recipies
77
- pattern : " mommy\\ .make\\ ( "
77
+ pattern : mommy\.make\(
78
78
hint : Please use mommy.make_recipe instead of mommy.make.
79
- filePattern : " (test_.*|conftest)\. py"
79
+ filePattern : (test_.*|conftest)\.py
80
80
81
81
- name : the database is lava
82
- pattern : " @pytest.fixture.*\\ n[ ]*def [^(]+\\ ([^)]*(db|transactional_db)(, |\\ )) "
82
+ pattern : ' @pytest.fixture.*\n[ ]*def [^(]+\([^)]*(db|transactional_db)(, |\)) '
83
83
hint : Please do not create db fixtures but model_mommy recipies instead.
84
- filePattern : " .*\. py"
84
+ filePattern : .*\.py
85
85
86
86
- name : No logger in management commands
87
- pattern : " (logger|import logging)"
88
- hint : " Please write to self.stdout or self.stderr in favor of using a logger."
89
- filePattern : " \/ management\/ commands\/ .*\. py"
87
+ pattern : (logger|import logging)
88
+ hint : Please write to self.stdout or self.stderr in favor of using a logger.
89
+ filePattern : \/management\/commands\/.*\.py
90
90
91
91
.. _`pre-commit` : https://pre-commit.com/
92
92
.. _`relint-pre-commit.sh` : relint-pre-commit.sh
0 commit comments