git: d27c35123b92 - stable/14 - clang-format: Minor tweaks
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 20 May 2024 13:46:42 UTC
The branch stable/14 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=d27c35123b92a656170ebfc44383162812d79cd3
commit d27c35123b92a656170ebfc44383162812d79cd3
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-04-30 21:32:38 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-05-20 13:42:32 +0000
clang-format: Minor tweaks
Invert KeepEmptyLinesAtTheStartOfBlocks. We used to require an empty
line at the beginning of functions with no local variables, which I
believe is the reason for this setting. Now it is discouraged in new
code.
Tell clang-format to align consecutive macros, since we tend to do that.
clang-format's output isn't quite what we want here. Typically we have
a tab after a #define for some reason, and clang-format doesn't appear
to have an option for that. clang-format will also use a mix of tabs
and spaces to minimize indentation, which is also against our
convention. However, the result looks better with this setting than
without.
Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29870
(cherry picked from commit 2c18289b72c8594bb5dbe22d54ff3434a56ec6c6)
---
.clang-format | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.clang-format b/.clang-format
index 6c541a571e1d..3d436fa0b35d 100644
--- a/.clang-format
+++ b/.clang-format
@@ -2,6 +2,7 @@
---
BasedOnStyle: WebKit
AlignAfterOpenBracket: DontAlign
+AlignConsecutiveMacros: AcrossEmptyLines
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
@@ -94,6 +95,7 @@ ForEachMacros:
- TAILQ_FOREACH_SAFE
- VM_MAP_ENTRY_FOREACH
- VM_PAGE_DUMP_FOREACH
+SpaceBeforeParens: ControlStatementsExceptForEachMacros
IndentCaseLabels: false
IndentPPDirectives: None
Language: Cpp
@@ -162,7 +164,7 @@ IncludeCategories:
# http://llvm.org/docs/CodingStandards.html#include-style
IncludeIsMainRegex: 'BLAH_DONT_MATCH_ANYTHING'
SortIncludes: true
-KeepEmptyLinesAtTheStartOfBlocks: true
+KeepEmptyLinesAtTheStartOfBlocks: false
TypenameMacros:
- ARB_ELMTYPE
- ARB_HEAD