Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
81 lines (78 loc) · 2.22 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
81 lines (78 loc) · 2.22 KB
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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
args: ['--maxkb=512']
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
- id: end-of-file-fixer
exclude: |
(?x)^(
deploy/hps/server_env/requirements/.*\.txt
)$
- id: trailing-whitespace
files: \.(md|c|cc|cxx|cpp|cu|h|hpp|hxx|py)$
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
hooks:
- id: remove-crlf
- id: remove-tabs
files: \.(md|c|cc|cxx|cpp|cu|h|hpp|hxx|py)$
- repo: local
hooks:
- id: clang-format
name: clang-format
description: Format files with ClangFormat
entry: bash .precommit/clang_format.hook -i
language: system
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$
# For Python files
- repo: https://github.com/psf/black.git
rev: 24.4.2
hooks:
- id: black
files: (.*\.(py|pyi|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
# Flake8
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
args:
- --count
- --select=E9,F63,F7,F82,E721,F401
- --per-file-ignores=__init__.py:F401
- --show-source
- --statistics
# isort
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args:
- --profile=black
files: ^paddlex/
# check license
- repo: local
hooks:
- id: check-license-headers
name: Check License Headers
entry: python .precommit/check_license_headers.py
language: python
files: .*\.py$
- id: check-imports
name: Check Imports
entry: python .precommit/check_imports.py
language: python
files: ^paddlex/.*\.py$
additional_dependencies:
- stdlib-list==0.10.0
- setuptools
- id: check-py38-compat
name: Check Python 3.8 Compatibility
entry: python .precommit/check_py38_compat.py
language: python
files: ^paddlex/.*\.py$
exclude: ^paddlex/repo_manager/repos/