-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
52 lines (51 loc) · 1.51 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [ commit, push ]
default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
name: 检查yaml文件是否合规
- id: check-added-large-files
name: 检查是否提交了超大文件
- id: check-merge-conflict
name: 检查是否含有未解决的冲突
- repo: https://github.com/jorisroovers/gitlint
rev: v0.12.0
hooks:
- id: gitlint
name: "检查commit message是否符合 (add|mod|del|fix):.*"
- repo: https://github.com/pycqa/isort
rev: "5.10.1"
hooks:
- id: isort
name: "imports自动格式化"
args:
[
"--multi-line=3",
"--trailing-comma",
"--force-grid-wrap=0",
"--use-parentheses",
"--line-width=120",
]
- repo: https://github.com/psf/black
rev: "22.3.0"
hooks:
- id: black
name: "代码风格格式化"
args: [ "--line-length=120", "--target-version=py38" ]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: flake8
# 在black格式化之后再触发flake8
name: flake8检查
args:
[
"--max-line-length=120",
"--exclude=__init__.py",
"--ignore=E203,E501,W503,W291,E402",
]