From a1d6693f8bc6c56038d2410e8d5ddbe0087c4d76 Mon Sep 17 00:00:00 2001 From: Guillaume Giraud Date: Mon, 18 Mar 2024 09:44:24 +0100 Subject: [PATCH] Exclude macros from clang-format pre-commit hook formatting --- .pre-commit-config.yaml | 2 +- include/tsid/macros.hpp | 2 +- include/tsid/tasks/task-contact-force.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a873326a..0b7d133e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: rev: v16.0.3 hooks: - id: clang-format - args: ['--style={BasedOnStyle: Google,SortIncludes: false}'] + args: ['--style={BasedOnStyle: Google, SortIncludes: false, WhitespaceSensitiveMacros: ["TSID_DISABLE_WARNING"]}'] - repo: https://github.com/pappasam/toml-sort rev: v0.23.1 hooks: diff --git a/include/tsid/macros.hpp b/include/tsid/macros.hpp index 0dcc4254..362baae8 100644 --- a/include/tsid/macros.hpp +++ b/include/tsid/macros.hpp @@ -18,7 +18,7 @@ #define TSID_DISABLE_WARNING(warningName) \ TSID_DO_PRAGMA(GCC diagnostic ignored #warningName) #define TSID_DISABLE_WARNING_DEPRECATED \ - TSID_DISABLE_WARNING(-Wdeprecated - declarations) + TSID_DISABLE_WARNING(-Wdeprecated-declarations) #else diff --git a/include/tsid/tasks/task-contact-force.hpp b/include/tsid/tasks/task-contact-force.hpp index 72b85fc1..38076f31 100644 --- a/include/tsid/tasks/task-contact-force.hpp +++ b/include/tsid/tasks/task-contact-force.hpp @@ -39,7 +39,7 @@ class TaskContactForce : public TaskBase { * tasks that involve all contacts, such as the CoP task. */ TSID_DISABLE_WARNING_PUSH - TSID_DISABLE_WARNING(-Woverloaded - virtual) + TSID_DISABLE_WARNING(-Woverloaded-virtual) virtual const ConstraintBase& compute( const double t, ConstRefVector q, ConstRefVector v, Data& data, const std::vector >* contacts) = 0;