-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
97 lines (88 loc) · 2.77 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Pre-commit configuration file.
# see https://pre-commit.com for more information
# see https://pre-commit.com/hooks.html for more hooks
repos:
# Out of the box hooks for pre-commit
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-xml
- id: check-case-conflict
- id: check-docstring-first
- id: debug-statements
- id: check-added-large-files
args: ["--maxkb=5000"]
# Hook to sort import statements
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args:
[
"--multi-line=3",
"--trailing-comma",
"--force-grid-wrap=0",
"--use-parentheses",
"--line-width=79",
"--profile=black",
]
# Hook to auto-format code to be compliant with PEP-8
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
args: [--verbose, --config=template-python/.pc_config/pyproject.toml]
# Hook to validate code style against PEP-8
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
args: [--config=template-python/.pc_config/.flake8]
additional_dependencies:
[flake8-bugbear, flake8-docstrings, flake8-tidy-imports]
# Hook to validate code style against PEP-8
- repo: https://github.com/pycqa/pylint
rev: v3.0.3
hooks:
- id: pylint
args: [--rcfile=template-python/.pc_config/.pylintrc]
# Hook to validate static typing in the code
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
args: [--config=template-python/.pc_config/mypy.ini]
additional_dependencies: [types-PyYAML, types-requests]
# Hook to auto-format non python files (i.a. md, yaml, xml, json)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
args:
[
--ignore-path=template-python/.pc_config/.prettierignore,
--config=template-python/.pc_config/.prettierrc,
--ignore-unknown
]
# Hooks to format C sources clang-format (formatter)
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
hooks:
- id: clang-format
args: [--style=Google]
# Hook to automatically trigger all tests (it will pass also if no tests are found, i.e. exit code is 5)
- repo: local
hooks:
- id: pytest
name: pytest
entry:
sh -c 'template-python/.pc_config/test_runner.sh'
types: [python]
verbose: true
language: system
pass_filenames: false
stages: [commit]