-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy path.pre-commit-config.yaml
104 lines (99 loc) · 3.64 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
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
rev: v1.5.5
hooks:
- id: remove-crlf
files: (?!.*third_party)^.*$ | (?!.*book)^.*$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args:
- --maxkb=20480
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
files: (?!.*third_party)^.*$ | (?!.*book)^.*$
- id: end-of-file-fixer
- id: trailing-whitespace
- id: requirements-txt-fixer
- id: sort-simple-yaml
- repo: https://gitee.com/mirrors_PyCQA/pylint
rev: v3.3.1
hooks:
- id: pylint
name: pylint-strict
exclude: (.*_test\.py)$
args: [--score=n, --load-plugins=pylint_secure_coding_standard]
additional_dependencies: [pylint-secure-coding-standard, numpy, pytest, matplotlib, scipy, torch, requests, graphviz, tabulate, rich, sparse, autograd, ply]
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks.git
rev: v2.14.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '4']
- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0
hooks:
- id: pycln
# - repo: https://github.com/pre-commit/mirrors-clang-format
# rev: v15.0.7
# hooks:
# - id: clang-format
# args: [-style=file]
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args: [--profile, black, --filter-files]
- repo: https://gitee.com/dnguyen/cmake-pre-commit-hooks-mirror
rev: v1.5.3
hooks:
# - id: clang-format
# require_serial: false
# args: [-i]
# files: .*\.(h|hpp|tpp|cpp|cc)$
# additional_dependencies: [clang-format==14.*]
# - id: cpplint
# require_serial: false
# args: [--quiet]
# files: .*\.(h|hpp|tpp|cpp|cc)$
# additional_dependencies: [cpplint]
- id: lizard
require_serial: false
files: .*\.(h|hpp|tpp|cpp|cc|py)$
args: [-l, cpp, -l, python, -l, java, -C, '19', -L, '100', -x, '*/tests/*', -x, '*/test/*', -x, '*/third_party/*', -W.whitelizard.txt, -w]
additional_dependencies: [lizard]
# - id: clang-tidy
# stages: [manual]
# args: [-Bbuild, -B.pre-commit-build]
# exclude: >-
# (?x)^(
# .*/kernel[0-9]+\.hpp|
# .*third_party/.*|
# .*\.cu
# )$
# TODO: Ignore cpp file check.
# - repo: https://gitee.com/btcong/pre-commit-hooks
# rev: v1.3.5
# hooks:
# - id: cppcheck
# files: .*\.(h|hpp|tpp|cpp|cc)$
# args: [--force, --enable=all, --error-exitcode=1, --inline-suppr, --std=c++14, --language=c++, --suppressions-list=.cppcheck.suppressions]
- repo: https://gitee.com/mirrors/flake8
rev: 5.0.4
hooks:
- id: flake8
args: [--docstring-convention, google]
name: flake8-strict
exclude: (.*_test\.py)$
additional_dependencies: [flake8-breakpoint, flake8-builtins, flake8-comprehensions, flake8-continuation, flake8-docstrings, flake8-eradicate, flake8-mutable, flake8-return, pep8-naming, flake8-secure-coding-standard]
- id: flake8
name: flake8-test-files
files: (.*_test\.py)$
additional_dependencies: [flake8-breakpoint, flake8-builtins, flake8-comprehensions, flake8-continuation, flake8-eradicate, flake8-mutable, flake8-return]