diff mbox series

[3/3] clang-format: align consecutive macro definitions

Message ID CAOLa=ZTAgaOK3KzsncTq1ZydXFbiG8M7MSsC9S9zUK4gdPPdOQ@mail.gmail.com (mailing list archive)
State Superseded
Headers show
Series clang-format: fix rules to make the CI job cleaner | expand

Commit Message

karthik nayak Oct. 9, 2024, 12:56 p.m. UTC
We generally align consecutive macro definitions for better readability.
So let's add the rule in clang-format to follow this.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
---
 .clang-format | 3 +++
 1 file changed, 3 insertions(+)

Comments

Toon Claes Oct. 10, 2024, 8:27 a.m. UTC | #1
Karthik Nayak <karthik.188@gmail.com> writes:

> We generally align consecutive macro definitions for better readability.
> So let's add the rule in clang-format to follow this.
>
> Signed-off-by: Karthik Nayak <karthik.188@gmail.com>

I think it's valuable to add an example what bad vs good formatted code
looks like.

Otherwise no comments about this series.

--
Toon
diff mbox series

Patch

diff --git a/.clang-format b/.clang-format
index af12a038f7..d76d5f1e6a 100644
--- a/.clang-format
+++ b/.clang-format
@@ -36,6 +36,9 @@  AlignConsecutiveAssignments: false
 # double b = 3.14;
 AlignConsecutiveDeclarations: false

+# Align consecutive macro definitions.
+AlignConsecutiveMacros: true
+
 # Align escaped newlines as far left as possible
 # #define A   \
 #   int aaaa; \