-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.pre-commit-config.yaml
100 lines (98 loc) · 3.33 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
# Copyright (c) 2022-2023 Arm Limited and/or its affiliates
# SPDX-License-Identifier: MIT
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: >
.patch|
(?x)^(
bsp/library/|
components/security/freertos_ota_pal_psa/library/|
components/security/freertos-pkcs11-psa/library/|
components/connectivity/iot_socket/library/|
components/connectivity/iot_vsocket/library/|
components/connectivity/iot_vsocket/integration/inc/transport_interface_api.h|
components/security/mbedtls/|
components/security/trusted_firmware-m/library/|
components/aws_iot/|
components/connectivity/backoff_algorithm/|
applications/helpers/logging/|
components/freertos_kernel/|
components/connectivity/freertos_plus_tcp/|
components/tools/freertos_libraries_integration_tests/|
components/tools/unity/
)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
args: ['--maxkb=2500']
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
args:
- "--config tools/ci/gitlint/.gitlint"
- repo: https://github.com/psf/black
rev: 23.10.1
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
args: # arguments to configure flake8
# making line length compatible with black
- "--max-line-length=88"
- repo: local
hooks:
- id: cppcheck
name: cppcheck
description: Run `cppcheck` against C/C++ source files
language: system
files: \.(c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
entry: cppcheck --error-exitcode=1
args: [
"--force",
"--std=c99",
"--std=c++14",
# enable everything except "information" level.
"--enable=style,performance,warning,portability",
"--template=gcc",
"--inline-suppr",
# Do not fail for internal cppcheck error
"--suppress=internalAstError",
# As we are passing list of suppression list, some files may
# not need to suppress any or all of the suppressions producing
# unmatchedSuppression by cppcheck. Ignore such cases.
"--suppress=unmatchedSuppression",
# useStlAlgorithm cannot be mandated in embedded projects
"--suppress=useStlAlgorithm"
]
- repo: local
hooks:
- id: uncrustify
name: uncrustify
description: Run 'uncrustify' C/C++ code formatter
language: script
entry: tools/scripts/run_uncrustify.sh
require_serial: true
- repo: local
hooks:
- id: banned-api
name: banned-api
entry: banned-api-hook
description: Checks if source code uses banned apis
types_or: [c, c++]
language: python
- repo: local
hooks:
- id: dependencies-check
name: dependencies-check
description: Checks listed dependencies in manifest.yml
language: script
entry: tools/scripts/run_dependencies_check.sh
require_serial: true