-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
56 lines (55 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
# 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.9
repos:
- repo: https://gitee.com/xunxu/pre-commit-hooks.git
rev: v4.3.0
hooks:
- id: check-yaml
name: 检查yaml文件是否合规
- id: check-added-large-files
name: 检查是否提交了超大文件
- id: check-merge-conflict
name: 检查是否含有未解决的冲突
- repo: https://gitee.com/mirrors_jorisroovers/gitlint
rev: v0.18.0
hooks:
- id: gitlint
name: "检查commit message是否符合 (add|mod|del|fix):.*"
- repo: local
hooks:
- id: isort
name: "imports自动格式化"
entry: isort
language: python
types: [python]
args:
[
"--profile", "black",
"--multi-line=3",
"--trailing-comma",
"--force-grid-wrap=0",
"--use-parentheses",
"--line-width=120",
]
- repo: https://gitee.com/xunxu/black
rev: 22.3.0
hooks:
- id: black
name: "代码风格格式化"
exclude: .venv
args: ["--line-length=120", "--target-version=py38"]
- repo: https://gitee.com/xunxu/pre-commit-hooks.git
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",
]