Skip to content

Commit 3bd5a23

Browse files
committed
Fix filename patterns
1 parent 3ead316 commit 3bd5a23

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

.relint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- name: No ToDo
2-
pattern: "[tT][oO][dD][oO]"
2+
pattern: '[tT][oO][dD][oO]'
33
hint: Get it done right away!
4-
filePattern: "((?!test_).).*\\.(py|js)"
4+
filePattern: ^(?!.*test_).*\.(py|js)$
55
error: false

README.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ You can write your own regular rules in a YAML file, like so:
2020
.. code-block:: YAML
2121
2222
- name: No ToDo
23-
pattern: "[tT][oO][dD][oO]"
23+
pattern: '[tT][oO][dD][oO]'
2424
hint: Get it done right away!
25-
filePatter: ".*\.(py|js)"
25+
filePattern: .*\.(py|js)
2626
error: false
2727
2828
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
5454
This option is useful for pre-commit purposes. Here an example of how to use it
5555
with `pre-commit`_ framework:
5656

57-
.. code-block:: YAML
57+
.. code-block:: yaml
5858
5959
- repo: https://github.com/codingjoe/relint
6060
rev: 1.2.0
@@ -69,24 +69,24 @@ Samples
6969
.. code-block:: yaml
7070
7171
- name: db fixtures
72-
pattern: "def test_[^(]+\\([^)]*(customer|product)(, |\\))"
72+
pattern: 'def test_[^(]+\([^)]*(customer|product)(, |\))'
7373
hint: Use model_mommy recipies instead of db fixtures.
74-
filePattern: "test_.*\.py"
74+
filePattern: test_.*\.py
7575
7676
- name: model_mommy recipies
77-
pattern: "mommy\\.make\\("
77+
pattern: mommy\.make\(
7878
hint: Please use mommy.make_recipe instead of mommy.make.
79-
filePattern: "(test_.*|conftest)\.py"
79+
filePattern: (test_.*|conftest)\.py
8080
8181
- name: the database is lava
82-
pattern: "@pytest.fixture.*\\n[ ]*def [^(]+\\([^)]*(db|transactional_db)(, |\\))"
82+
pattern: '@pytest.fixture.*\n[ ]*def [^(]+\([^)]*(db|transactional_db)(, |\))'
8383
hint: Please do not create db fixtures but model_mommy recipies instead.
84-
filePattern: ".*\.py"
84+
filePattern: .*\.py
8585
8686
- 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
9090
9191
.. _`pre-commit`: https://pre-commit.com/
9292
.. _`relint-pre-commit.sh`: relint-pre-commit.sh

relint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def main(args=sys.argv):
234234

235235

236236
if not sys.warnoptions:
237-
warnings.simplefilter("default")
237+
warnings.simplefilter('default')
238238

239239

240240
if __name__ == '__main__':

0 commit comments

Comments
 (0)