Skip to content

Commit da625e4

Browse files
committed
Added pre-commit-hooks, so some fast checks are performed before the heavy checks happen
1 parent a083901 commit da625e4

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
fail_fast: true
22

33
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
# This one has been added to fail fast on syntax errors
8+
# before running expensive pylint
9+
- id: check-ast
10+
types_or:
11+
- python
12+
- pyi
13+
exclude: "/(site-packages|development-[^/]*|docs|node_modules|__pycache__|\\..*)/$"
14+
- id: check-yaml
15+
types: [file]
16+
files: \.(yaml|yml)$
417
- repo: local
518
hooks:
619
- id: pylint
@@ -10,7 +23,8 @@ repos:
1023
types:
1124
- python
1225
exclude: "^[^/]*env/|dev-[^/]*/"
13-
entry: pylint -j 0
26+
entry: pylint
27+
args: [-j , "4", --source-roots, .]
1428
- id: mypy
1529
name: Local MyPy
1630
language: system
@@ -20,7 +34,8 @@ repos:
2034
exclude: "^[^/]*env/|dev-[^/]*/"
2135
require_serial: true
2236
# entry: ./basic-installer.bash mypy --strict
23-
entry: mypy --strict --show-error-codes --no-warn-unused-ignores
37+
entry: mypy
38+
args: [--strict, --show-error-codes, --no-warn-unused-ignores]
2439
# Main problem: python executable path, used to find the environment is hard
2540
# - repo: https://github.com/pre-commit/mirrors-mypy.git
2641
# rev: v1.2.0
@@ -39,5 +54,9 @@ repos:
3954
rev: 23.3.0
4055
hooks:
4156
- id: black
42-
exclude: "^[^/]*env/|dev-[^/]*/"
57+
name: black_apply
58+
exclude: "^[^/]*env/|development-[^/]*/|docs/"
59+
stages: [manual]
60+
- id: black
61+
exclude: "^[^/]*env/|development-[^/]*/|docs/"
4362
args: [--diff, --check]

0 commit comments

Comments
 (0)