-
Notifications
You must be signed in to change notification settings - Fork 25
/
.pre-commit-config.yaml
113 lines (103 loc) · 3.73 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: 'libraries/ui/'
repos:
- repo: https://github.com/igrr/astyle_py.git
rev: v1.0.5
hooks:
- id: astyle_py
args: ['--style=otbs', '--attach-namespaces', '--attach-classes', '--indent=spaces=4', '--convert-tabs', '--align-pointer=name', '--align-reference=name', '--keep-one-line-statements', '--pad-header', '--pad-oper']
- repo: https://github.com/espressif/check-copyright/
rev: v1.0.3
hooks:
- id: check-copyright
args: ['--config', 'check_copyright_config.yaml']
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
types: [python]
args: ['--config=.flake8', '--tee', '--benchmark']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
# note: whitespace exclusions use multiline regex, see https://pre-commit.com/#regular-expressions
# items are:
# 1 - some file extensions
# 2 - any file matching *test*/*expected* (for host tests, if possible use this naming pattern always)
# 3 - any file with known-warnings in the name
# 4 - any directory named 'testdata'
# 5 - protobuf auto-generated files
exclude: &whitespace_excludes |
(?x)^(
.+\.(md|rst|map|bin)|
.+test.*\/.*expected.*|
.+known-warnings.*|
.+\/testdata\/.+|
.*_pb2.py|
.*.pb-c.h|
.*.pb-c.c|
.*.yuv
)$
- id: end-of-file-fixer
exclude: *whitespace_excludes
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: mixed-line-ending
args: ['-f=lf']
- id: double-quote-string-fixer
- id: no-commit-to-branch
name: Do not use more than one slash in the branch name
args: ['--pattern', '^[^/]*/[^/]*/']
- id: no-commit-to-branch
name: Do not use uppercase letters in the branch name
args: ['--pattern', '^[^A-Z]*[A-Z]']
- repo: https://github.com/espressif/conventional-precommit-linter
rev: v1.8.0
hooks:
- id: conventional-precommit-linter
stages: [commit-msg]
args:
- --subject-min-length=15
- --body-max-line-length=200
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: ['-w' , '--config', '.codespellrc']
- repo: local
hooks:
- id: check-executables
name: Check File Permissions
entry: .gitlab/tools/check_executables.py --action executables
language: python
types: [executable]
exclude: '\.pre-commit/.+'
- id: check-executable-list
name: Validate executable-list.txt
entry: .gitlab/tools/check_executables.py --action list
language: python
pass_filenames: false
always_run: true
- repo: local
hooks:
- id: sync-conf-files
name: Update when configuration files change
entry: python3 tools/sync_conf_files.py ./
language: system
files: '.*ESP_Panel_(Board_Custom|Board_Supported|Conf)\.h'
- repo: local
hooks:
- id: check-file-versions
name: Update when versions change
entry: python3 tools/check_file_version.py ./
language: system
files: '(.*ESP_Panel_(Board_Custom|Board_Supported|Conf)\.h|library.properties|.*ESP_PanelVersions.h)'
- repo: local
hooks:
- id: check-library-versions
name: Check library versions
entry: ./.github/scripts/check_lib_versions.sh
language: system
files: '(idf_component.yml|library.properties)'