-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
115 lines (106 loc) · 3.24 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-ast
name: Valid Python files
description: simply checks whether the files parse as valid python.
- id: check-json
name: JSON with parseable syntax
description: checks json files for parseable syntax.
files: \.(json)$
- id: check-toml
name: TOML with parseable syntax
description: checks toml files for parseable syntax.
files: \.(toml)$
- id: check-yaml
name: YAML with parseable syntax
description: checks yaml files for parseable syntax.
files: \.(yml|yaml)$
- id: end-of-file-fixer
name: File is either empty or ends with one newline
description: ensures that a file is either empty, or ends with one newline.
files: \.(py|sh|rst|yml|yaml)$
- id: trailing-whitespace
name: Trims trailing whitespace
description: trims trailing whitespace.
files: \.(py|sh|rst|yml|yaml)$
# black
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
name: Black code formatter
description: code formatter
# isort
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
name: Sort module imports in .py files
description: Sort module imports in .py files
args: [ "--profile", "black", "--filter-files" ]
# ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.2.2
hooks:
# Ruff formatter
- id: ruff-format
name: Ruff
# flake8
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
name: Checking the style and quality of Python code
args: [ '--max-line-length=88' ]
exclude: ^/tests
language: python
language_version: python3
types_or: [ python ]
stages: [ commit ]
# mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
name: Data typing
args: [ '--ignore-missing-imports' ]
# sqlfluff
- repo: https://github.com/sqlfluff/sqlfluff
rev: 3.0.7
hooks:
- id: sqlfluff-fix
name: SQLFluff
# Set a couple of default flags:
# - `--show-lint-violations` shows issues to not require running `sqlfluff lint`
# - `--processes 0` to use maximum parallelism
entry: sqlfluff fix --show-lint-violations --processes 0
language: python
files: \.(sql)$
description: "Fixes sql lint errors with SQLFluff"
types: [ sql ]
require_serial: true
additional_dependencies: [ ]
# pydocstyle
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
name: Documentation
args: [ --convention=numpy, --add-ignore=D100 ]
# bandit
- repo: https://github.com/PyCQA/bandit
rev: 1.7.7
hooks:
- id: bandit
name: Security checker
args: ['--exclude', 'api/tests/*', '-s', 'B311']
# commitizen
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.13.0
hooks:
- id: commitizen
name: Commit name conventions
args: [ '--' ]