# See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks default_stages: [commit] # Exclude some directories or files from all hooks exclude: &global_excludes | (?x)^( .+\/STM32\/.+| .*.crt )$ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.0.1 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 directory named 'testdata' # 4 - protobuf auto-generated files exclude: &whitespace_excludes | (?x)^( .+\.(md|rst|map|bin)| .+test.*\/.*expected.*| .+\/testdata\/.+| .*_pb2.py| .*.pb-c.h| .*.pb-c.c| .*.patch| .*.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: 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-module-config name: Check Module Configurations entry: tools/ci/check_module_config.py language: python pass_filenames: false always_run: true - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.0.1 hooks: - id: file-contents-sorter files: 'tools\/ci\/(executable-list\.txt|check_copyright_ignore\.txt)' - repo: https://github.com/espressif/check-copyright/ rev: v1.0.3 hooks: - id: check-copyright args: ['--ignore', 'tools/ci/check_copyright_ignore.txt', '--config', 'tools/ci/check_copyright_config.yaml'] - repo: https://github.com/espressif/astyle_py.git rev: v1.0.5 hooks: - id: astyle_py # If you are modifying astyle version, update tools/format.sh as well args: ['--astyle-version=3.4.7', '--rules=tools/ci/astyle-rules.yml'] - repo: https://github.com/codespell-project/codespell rev: v2.4.1 hooks: - id: codespell # This hook will automatically fix typos as "write-changes" is set to "true" in the .codespellrc configuration file. You can check the modified file and add the changes before committing. # If you find false positives, you can add the specific terms that should not be flagged to "ignore-words-list" in the .codespellrc args: [--config=.codespellrc]