qmk_userspace/.pre-commit-config.yaml
2026-03-02 13:31:03 -08:00

76 lines
2.4 KiB
YAML

fail_fast: false
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-tabs
exclude: "vendor-prefixes\\.txt$|.git/COMMIT_EDITMSG"
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.5
hooks:
- id: clang-format
types_or: [c++, c]
args:
- -i
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
exclude: |
(?x)^(
.git/COMMIT_EDITMSG|
CHANGELOG.md|
.release-please-manifest.json|
CODE_OF_CONDUCT.md|
.*/keymap.json
)$
exclude_types: [inc]
# Workaround for https://github.com/pre-commit/mirrors-prettier/issues/29
additional_dependencies:
- prettier@v4.0.0-alpha.12
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
exclude: |
(?x)^(
(.*)/autocorrect_data.h|
.gitattributes|
svds/.*.svd
)$
args: ["-I", ".codespell_ignore", "-w"]
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
exclude: |
(?x)^(
.vscode/.*|
.cspell.json|
.devcontainer/devcontainer.json|
.*/keymap.json
)$
- id: check-case-conflict
- id: check-illegal-windows-names
- id: check-added-large-files
- id: check-shebang-scripts-are-executable
- id: mixed-line-ending
args: ["--fix=lf"]
- id: pretty-format-json
exclude: |
(?x)^(
.vscode/.*|
.cspell.json|
.devcontainer/devcontainer.json|
qmk.json
)$
args: ["--autofix", "--indent=4"]
- id: detect-private-key
- id: fix-byte-order-marker