2020-10-21 07:30:49 -04:00
|
|
|
# See https://pre-commit.com for more information
|
|
|
|
# See https://pre-commit.com/hooks.html for more hooks
|
|
|
|
|
|
|
|
repos:
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2020-12-20 23:42:29 -05:00
|
|
|
rev: v3.4.0
|
2020-10-21 07:30:49 -04:00
|
|
|
hooks:
|
|
|
|
- id: trailing-whitespace
|
2020-11-12 22:22:18 -05:00
|
|
|
# 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 directory named 'testdata'
|
|
|
|
# 4 - IDF monitor test data
|
|
|
|
exclude: &whitespace_excludes |
|
|
|
|
(?x)^(
|
|
|
|
.+\.(md|rst|map|bin)|
|
|
|
|
.+test.*\/.*expected.*|
|
|
|
|
.+\/testdata\/.+|
|
|
|
|
.+test_idf_monitor\/tests\/.+
|
|
|
|
)$
|
2020-10-21 07:30:49 -04:00
|
|
|
- id: end-of-file-fixer
|
2020-11-12 22:22:18 -05:00
|
|
|
exclude: *whitespace_excludes
|
2020-10-21 07:30:49 -04:00
|
|
|
- id: check-executables-have-shebangs
|
|
|
|
- id: mixed-line-ending
|
|
|
|
args: ['-f=lf']
|
2020-12-20 23:42:29 -05:00
|
|
|
- id: double-quote-string-fixer
|
2022-11-15 00:33:02 -05:00
|
|
|
- repo: https://github.com/PyCQA/flake8
|
2020-11-03 21:23:47 -05:00
|
|
|
rev: 3.8.4
|
2020-10-21 07:30:49 -04:00
|
|
|
hooks:
|
|
|
|
- id: flake8
|
|
|
|
args: ['--config=.flake8', '--tee', '--benchmark']
|
2020-12-20 23:42:29 -05:00
|
|
|
- repo: https://github.com/pycqa/isort
|
|
|
|
rev: 5.6.4
|
|
|
|
hooks:
|
|
|
|
- id: isort
|
|
|
|
name: isort (python)
|
2020-10-21 07:30:49 -04:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: check-executables
|
|
|
|
name: Check File Permissions
|
|
|
|
entry: tools/ci/check_executables.py --action executables
|
|
|
|
language: python
|
|
|
|
types: [executable]
|
|
|
|
exclude: '\.pre-commit/.+'
|
|
|
|
- id: check-executable-list
|
|
|
|
name: Validate executable-list.txt
|
|
|
|
entry: tools/ci/check_executables.py --action list
|
|
|
|
language: python
|
|
|
|
pass_filenames: false
|
|
|
|
always_run: true
|
|
|
|
- id: check-kconfigs
|
|
|
|
name: Validate Kconfig files
|
2020-10-30 05:28:24 -04:00
|
|
|
entry: tools/ci/check_kconfigs.py
|
2020-10-21 07:30:49 -04:00
|
|
|
language: python
|
2020-10-30 05:28:24 -04:00
|
|
|
files: '^Kconfig$|Kconfig.*$'
|
2020-10-21 07:30:49 -04:00
|
|
|
- id: check-deprecated-kconfigs-options
|
|
|
|
name: Check if any Kconfig Options Deprecated
|
2020-10-30 05:28:24 -04:00
|
|
|
entry: tools/ci/check_deprecated_kconfigs.py
|
2020-10-21 07:30:49 -04:00
|
|
|
language: python
|
2020-10-30 05:28:24 -04:00
|
|
|
files: 'sdkconfig\.ci$|sdkconfig\.rename$|sdkconfig.*$'
|
2020-10-21 07:30:49 -04:00
|
|
|
- id: cmake-lint
|
|
|
|
name: Check CMake Files Format
|
2020-11-08 21:59:18 -05:00
|
|
|
entry: cmakelint --linelength=120 --spaces=4 --filter=-whitespace/indent
|
2020-10-21 07:30:49 -04:00
|
|
|
language: python
|
|
|
|
additional_dependencies:
|
2020-11-08 18:06:05 -05:00
|
|
|
- cmakelint==1.4.1
|
2020-10-21 07:30:49 -04:00
|
|
|
files: 'CMakeLists.txt$|\.cmake$'
|
|
|
|
exclude: '\/third_party\/'
|
|
|
|
- id: check-codeowners
|
|
|
|
name: Validate Codeowner File
|
|
|
|
entry: tools/ci/check_codeowners.py ci-check
|
|
|
|
language: python
|
|
|
|
files: '\.gitlab/CODEOWNERS'
|
|
|
|
pass_filenames: false
|
2021-04-26 03:58:03 -04:00
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
|
|
rev: v3.4.0
|
|
|
|
hooks:
|
|
|
|
- id: file-contents-sorter
|
|
|
|
files: 'tools/ci/executable-list.txt'
|