Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update .clang-format configuration #147

Merged
merged 4 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# .clang-format
# .clang-format

# Recommended clang-format version: 19 or higher.
# Please note that alignment settings may not be supported in versions below 19.

# Base style to use
BasedOnStyle: Google
Expand All @@ -11,14 +14,29 @@ UseTab: Never
Language: Cpp

# Alignment settings
AlignConsecutiveDeclarations: true
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true

AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true

AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true

AlignTrailingComments: true

# Break settings
BreakBeforeBraces: Custom
BraceWrapping:
AfterFunction: true
BeforeElse: true
AfterExternBlock: true

AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
Expand All @@ -37,7 +55,7 @@ SpaceBeforeParensOptions:
AfterControlStatements: false

# Other settings
ColumnLimit: 160 # Disable column limit
ColumnLimit: 120

# Put each one of the function paremeters on its own line.
BinPackParameters: false
Expand Down
3 changes: 3 additions & 0 deletions app/xeve_app_args.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ typedef struct _ARGS_OPT
char desc[512]; /* description of option */
} ARGS_OPT;

// clang-format off

/* Define various command line options as a table */
static const ARGS_OPT args_opt_table[] = \
{
Expand Down Expand Up @@ -630,6 +632,7 @@ static const ARGS_OPT args_opt_table[] = \
},
{ARGS_END_KEY, "", ARGS_VAL_TYPE_NONE, 0, NULL, ""} /* termination */
};
// clang-format on

typedef struct _ARGS_PARSER ARGS_PARSER;
struct _ARGS_PARSER
Expand Down