-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy path.pre-commit-config.yaml
65 lines (65 loc) · 1.58 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
# Supported hooks: https://pre-commit.com/hooks.html
#
# The order of the repos matter. We need to run hooks that modify files before
# the one that validates them. Hooks should be ordered following these categories:
# 1. Generators
# 2. Formatters
# 3. Linters
---
repos:
###
### 1. Generators
###
# make generate
- repo: local
hooks:
- id: make-generate
name: Run make generate
language: system
entry: make generate
pass_filenames: false # only invoke once
###
### 2. Formatters
###
#
# Built-ins
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
# Black
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
args: ["--config", ".linters/black", "--experimental-string-processing"]
# isort
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "-l", "80"]
###
### 3. Linters
###
# Flake8
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: ["--config", ".linters/flake8"]
# Yamllint
- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
hooks:
- id: yamllint
args: ["--config-file", ".linters/yamllint"]
# Pylint - runs from inside the venv as it needs to validate imports
- repo: local
hooks:
- id: pylint
name: Run pylint
language: system
entry: make pylint
pass_filenames: false # only invoke once