From 76d767d96e2a6ad6b8b793d7770b0126ed1b1bb7 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 14 Mar 2022 09:37:44 -0700 Subject: [PATCH] Pre-Commit: Clang-Format CXX Endings `identify` used to detect our files does not catch all our file endings. --- .github/workflows/clang-format/clang-format.sh | 2 +- .pre-commit-config.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clang-format/clang-format.sh b/.github/workflows/clang-format/clang-format.sh index 0b99c629ab..d3ad0be059 100755 --- a/.github/workflows/clang-format/clang-format.sh +++ b/.github/workflows/clang-format/clang-format.sh @@ -7,6 +7,6 @@ else # received no arguments, find files on our own find include/ src/ test/ examples/ \ -regextype egrep \ - -type f -regex '.*\.(hpp|cpp|hpp\.in)$' \ + -type f -regex '.*\.(c|cpp|cxx|h|hpp|tpp)(\.in)?$' \ | xargs clang-format-13 -i fi diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c36ffc186a..dfb8ca679c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -68,6 +68,8 @@ repos: rev: v13.0.1 hooks: - id: clang-format + types: [file] + files: '.*\.(c|cpp|cxx|h|hpp|tpp)(\.in)?$' # Autoremoves unused Python imports - repo: https://github.com/hadialqattan/pycln