-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
127 lines (127 loc) · 3.68 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
116
117
118
119
120
121
122
123
124
125
126
127
default_language_version:
python: python3
node: "16.14.2"
exclude: |
(?x)
# Files that fail if changed manually
.*\.(diff|patch)$
repos:
# General
- repo: local
hooks:
- id: forbidden-files
name: forbidden files
entry: found forbidden files; remove them
language: fail
files: "\\.rej$"
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.2
hooks:
- id: prettier
stages: [commit]
additional_dependencies:
- "@prettier/[email protected]"
args:
- --plugin=@prettier/plugin-xml
- repo: local
hooks:
- id: autoflake
name: autoflake
entry: poetry run autoflake
language: system
types: [python]
require_serial: true
args:
- --in-place
- --expand-star-imports
- --ignore-init-module-imports
- --remove-all-unused-imports
- --remove-duplicate-keys
- --remove-unused-variables
- id: pyupgrade
name: pyupgrade
description: Automatically upgrade syntax for newer versions.
entry: poetry run pyupgrade
language: system
types: [python]
- id: black
name: black
description: "Black: The uncompromising Python code formatter"
entry: poetry run black
language: system
minimum_pre_commit_version: 2.9.2
require_serial: true
types_or: [python, pyi]
- id: blacken-docs
name: blacken-docs
description: Run `black` on python code blocks in documentation files
entry: poetry run blacken-docs
language: system
files: '\.(rst|md|markdown|py|tex)$'
- id: isort
name: isort
entry: poetry run isort
require_serial: true
language: system
types_or: [cython, pyi, python]
minimum_pre_commit_version: "2.9.2"
args:
- --filter-files
- --settings=.
- &flake8
id: flake8
name: flake8 except __init__.py
description:
"`flake8` is a command-line utility for enforcing style consistency across
Python projects."
entry: poetry run flake8
language: system
types: [python]
require_serial: true
exclude: /__init__\.py$
- <<: *flake8
name: flake8 for __init__.py
args:
# ignore unused imports in __init__.py
- --extend-ignore=F401
files: /__init__\.py$
- id: poetry-check
name: poetry-check
description: run poetry check to validate config
entry: poetry check
language: system
pass_filenames: false
files: ^pyproject.toml$
- id: commitizen
name: commitizen check
description: "Check whether the commit message follows commiting rules"
entry: poetry run cz check --commit-msg-file
language: system
require_serial: true
stages: [commit-msg]
minimum_pre_commit_version: "0.15.4"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-added-large-files
args:
- --maxkb=1000
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
exclude: gitlab-ci
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args:
- --fix=lf
- id: trailing-whitespace
- id: check-ast
- id: check-builtin-literals
- id: debug-statements
- id: fix-encoding-pragma
args:
- --remove
- id: requirements-txt-fixer