Skip to content

Commit

Permalink
Exclude macros from clang-format pre-commit hook formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume227 committed Mar 18, 2024
1 parent 0a83575 commit a1d6693
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion include/tsid/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion include/tsid/tasks/task-contact-force.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::shared_ptr<ContactLevel> >* contacts) = 0;
Expand Down

0 comments on commit a1d6693

Please sign in to comment.