From ee94ba3df924daeee7f458d4d7a7c81928ef55aa Mon Sep 17 00:00:00 2001 From: Se7enZ Date: Fri, 12 Dec 2025 11:27:12 +0100 Subject: [PATCH] devtools: Add clang-format to pre-commit. --- .pre-commit-config.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 16b52dd31..9c69e945b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,6 +18,19 @@ repos: - id: shellcheck args: [ -fgcc ] +- repo: https://github.com/pre-commit/mirrors-clang-format + rev: v19.1.4 + hooks: + - id: clang-format + description: Runs formatting checks on the c code and and throws errors if suggestions + are detected, without modifying the code. Style is defined in `.clang-format`. When + encountering formatting-related errors, run `clang-format -i ` to make + (destructively) the suggestions and evalute the resulting diff for more context. + args: [ --dry-run, -Werror ] + entry: clang-format + types: [ c ] + stages: [ manual ] + - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.30.0 hooks: