From 550a94df2e42c5c129e8844441d5086d4ad134bb Mon Sep 17 00:00:00 2001 From: Liam Keegan Date: Thu, 21 Mar 2024 08:23:22 +0100 Subject: [PATCH 1/3] Limit clang-format to c/c++/cuda types - as done in https://github.com/ssciwr/clang-format-wheel pre-commit example - implicit default value of `types_or` is `[c++, c, c#, cuda, java, javascript, json, objective-c, proto, textproto]` - some of these, in particular javascript and json, can interfere with other hooks --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4fba0dc..3f460c0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,6 +60,7 @@ repos: rev: v18.1.1 hooks: - id: clang-format # Format C++ code with Clang-Format - automatically applying the changes + types_or: [c++, c, cuda] args: - --style=Mozilla From e36dc2c533168530d0e4ec1a049c36f6280330f4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 07:29:27 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- precommend/.pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/precommend/.pre-commit-config.yaml b/precommend/.pre-commit-config.yaml index 4fba0dc..3f460c0 100644 --- a/precommend/.pre-commit-config.yaml +++ b/precommend/.pre-commit-config.yaml @@ -60,6 +60,7 @@ repos: rev: v18.1.1 hooks: - id: clang-format # Format C++ code with Clang-Format - automatically applying the changes + types_or: [c++, c, cuda] args: - --style=Mozilla From 652511545a20d5954d56f9b035e1efd70d6a6cfd Mon Sep 17 00:00:00 2001 From: Liam Keegan Date: Thu, 21 Mar 2024 12:48:18 +0100 Subject: [PATCH 3/3] add objective-c and c# to types_or to match clang_format rule --- .pre-commit-config.yaml | 2 +- precommend/.pre-commit-config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f460c0..86cd69b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,7 +60,7 @@ repos: rev: v18.1.1 hooks: - id: clang-format # Format C++ code with Clang-Format - automatically applying the changes - types_or: [c++, c, cuda] + types_or: [c++, c, c#, cuda, objective-c] args: - --style=Mozilla diff --git a/precommend/.pre-commit-config.yaml b/precommend/.pre-commit-config.yaml index 3f460c0..86cd69b 100644 --- a/precommend/.pre-commit-config.yaml +++ b/precommend/.pre-commit-config.yaml @@ -60,7 +60,7 @@ repos: rev: v18.1.1 hooks: - id: clang-format # Format C++ code with Clang-Format - automatically applying the changes - types_or: [c++, c, cuda] + types_or: [c++, c, c#, cuda, objective-c] args: - --style=Mozilla