Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

Commit 6ceb928

Browse files
committed
Move checks to the end
It's better to reformat first and then lint later, or linters could fail with stuff that is later fixed when reformatting.
1 parent 276a094 commit 6ceb928

File tree

2 files changed

+67
-67
lines changed

2 files changed

+67
-67
lines changed

.pre-commit-config.yaml

+28-28
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,6 @@ repos:
1010
entry: found forbidden files; remove them
1111
language: fail
1212
files: "\\.rej$"
13-
- repo: https://github.com/pre-commit/pre-commit-hooks
14-
rev: v3.2.0
15-
hooks:
16-
- id: check-added-large-files
17-
args:
18-
- --maxkb=1000
19-
- id: check-case-conflict
20-
- id: check-executables-have-shebangs
21-
- id: check-json
22-
- id: check-merge-conflict
23-
- id: check-symlinks
24-
- id: check-toml
25-
- id: check-xml
26-
- id: check-yaml
27-
- id: detect-private-key
28-
- id: end-of-file-fixer
29-
- id: mixed-line-ending
30-
args:
31-
- --fix=lf
32-
- id: trailing-whitespace
33-
- id: check-ast
34-
- id: check-builtin-literals
35-
- id: check-docstring-first
36-
- id: debug-statements
37-
- id: fix-encoding-pragma
38-
args:
39-
- --remove
40-
- id: requirements-txt-fixer
4113
- repo: https://github.com/pre-commit/mirrors-prettier
4214
rev: v2.1.2
4315
hooks:
@@ -87,3 +59,31 @@ repos:
8759
# ignore unused imports in __init__.py
8860
- --extend-ignore=F401
8961
files: /__init__\.py$
62+
- repo: https://github.com/pre-commit/pre-commit-hooks
63+
rev: v3.2.0
64+
hooks:
65+
- id: check-added-large-files
66+
args:
67+
- --maxkb=1000
68+
- id: check-case-conflict
69+
- id: check-executables-have-shebangs
70+
- id: check-json
71+
- id: check-merge-conflict
72+
- id: check-symlinks
73+
- id: check-toml
74+
- id: check-xml
75+
- id: check-yaml
76+
- id: detect-private-key
77+
- id: end-of-file-fixer
78+
- id: mixed-line-ending
79+
args:
80+
- --fix=lf
81+
- id: trailing-whitespace
82+
- id: check-ast
83+
- id: check-builtin-literals
84+
- id: check-docstring-first
85+
- id: debug-statements
86+
- id: fix-encoding-pragma
87+
args:
88+
- --remove
89+
- id: requirements-txt-fixer

.pre-commit-config.yaml.jinja

+39-39
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,6 @@ repos:
1010
entry: found forbidden files; remove them
1111
language: fail
1212
files: "\\.rej$"
13-
- repo: https://github.com/pre-commit/pre-commit-hooks
14-
rev: v3.2.0
15-
hooks:
16-
{%- if biggest_kbs %}
17-
- id: check-added-large-files
18-
args:
19-
- --maxkb={{ biggest_kbs }}
20-
{%- endif %}
21-
- id: check-case-conflict
22-
- id: check-executables-have-shebangs
23-
- id: check-json
24-
- id: check-merge-conflict
25-
- id: check-symlinks
26-
- id: check-toml
27-
- id: check-xml
28-
- id: check-yaml
29-
- id: detect-private-key
30-
- id: end-of-file-fixer
31-
- id: mixed-line-ending
32-
args:
33-
- --fix=lf
34-
{%- if protected_branches %}
35-
- id: no-commit-to-branch
36-
args:
37-
{%- for branch in protected_branches %}
38-
- --branch={{ branch }}
39-
{%- endfor %}
40-
{%- endif %}
41-
- id: trailing-whitespace
42-
{%- if python %}
43-
- id: check-ast
44-
- id: check-builtin-literals
45-
- id: check-docstring-first
46-
- id: debug-statements
47-
- id: fix-encoding-pragma
48-
args:
49-
- --remove
50-
- id: requirements-txt-fixer
51-
{%- endif %}
5213
{#- Prettier is considered general because it reformats Markdown, YAML and XML
5314
(with the activated plugin), which are too common as to ask the user,
5415
although it's true that it will also format JS, HTML, CSS and others #}
@@ -123,3 +84,42 @@ repos:
12384
hooks:
12485
- id: ansible-lint
12586
{%- endif %}
87+
- repo: https://github.com/pre-commit/pre-commit-hooks
88+
rev: v3.2.0
89+
hooks:
90+
{%- if biggest_kbs %}
91+
- id: check-added-large-files
92+
args:
93+
- --maxkb={{ biggest_kbs }}
94+
{%- endif %}
95+
- id: check-case-conflict
96+
- id: check-executables-have-shebangs
97+
- id: check-json
98+
- id: check-merge-conflict
99+
- id: check-symlinks
100+
- id: check-toml
101+
- id: check-xml
102+
- id: check-yaml
103+
- id: detect-private-key
104+
- id: end-of-file-fixer
105+
- id: mixed-line-ending
106+
args:
107+
- --fix=lf
108+
{%- if protected_branches %}
109+
- id: no-commit-to-branch
110+
args:
111+
{%- for branch in protected_branches %}
112+
- --branch={{ branch }}
113+
{%- endfor %}
114+
{%- endif %}
115+
- id: trailing-whitespace
116+
{%- if python %}
117+
- id: check-ast
118+
- id: check-builtin-literals
119+
- id: check-docstring-first
120+
- id: debug-statements
121+
- id: fix-encoding-pragma
122+
args:
123+
- --remove
124+
- id: requirements-txt-fixer
125+
{%- endif %}

0 commit comments

Comments
 (0)