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 #6440

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
66 changes: 61 additions & 5 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,25 +1,81 @@
BasedOnStyle : google
SpaceBeforeParens : Always
IndentWidth : 4
BreakBeforeBraces : Linux
BreakBeforeBraces : Custom
BraceWrapping :
BeforeElse : true
AfterFunction : true
UseTab: Never
AllowShortIfStatementsOnASingleLine : false
ConstructorInitializerAllOnOneLineOrOnePerLine : true
AllowShortFunctionsOnASingleLine : false
AllowShortLoopsOnASingleLine : false
BinPackParameters : false
BinPackArguments : false
AllowAllParametersOfDeclarationOnNextLine : false
AlignTrailingComments : true
ColumnLimit : 88
ColumnLimit : 80

# do not put all arguments on one line unless it's the same line as the call
PenaltyBreakBeforeFirstCallParameter : 10000000
PenaltyReturnTypeOnItsOwnLine : 65000
PenaltyBreakString : 10

# These improve formatting results but require clang 3.6/7 or higher
# preserve formatting of arguments to pack/unpack functions
# found by running: rg --only-matching --no-filename --no-line-number '(flux|json)(_[^ ,()]+)?_(un)?pack' | sort -u
WhitespaceSensitiveMacros :
- flux_conf_unpack
- flux_event_pack
- flux_event_publish_pack
- flux_event_unpack
- flux_job_result_get_unpack
- flux_jobspec1_attr_pack
- flux_jobspec1_attr_unpack
- flux_jobspec_info_unpack
- flux_jobtap_event_post_pack
- flux_kvs_lookup_get_unpack
- flux_kvs_lookup_unpack
- flux_kvs_txn_pack
- flux_lookup_get_unpack
- flux_mrpc_pack
- flux_msg_pack
- flux_msg_unpack
- flux_plugin_arg_pack
- flux_plugin_arg_unpack
- flux_plugin_args_unpack
- flux_plugin_conf_unpack
- flux_request_unpack
- flux_respond_pack
- flux_rpc_get_unpack
- flux_rpc_pack
- flux_shell_getopt_unpack
- flux_shell_info_unpack
- flux_shell_jobspec_info_unpack
- flux_shell_rank_info_unpack
- flux_shell_rpc_pack
- flux_shell_setopt_pack
- flux_shell_setopt_unpack
- flux_shell_task_info_unpack
- json_pack
- json_unpack

# treat foreach macros as for loops
ForEachMacros :
- json_array_foreach
- json_object_foreach

SortIncludes : false
BreakBeforeBinaryOperators : NonAssignment
AlignAfterOpenBracket: true
BinPackArguments : false
AlignAfterOpenBracket: Align
AlignOperands : true
BreakBeforeTernaryOperators : true
AllowAllParametersOfDeclarationOnNextLine : false
SpaceBeforeSquareBrackets: false
IndentPPDirectives: None

# will appear in clang-20
AlignConsecutiveMacros: true

#
# vi:tabstop=4 shiftwidth=4 expandtab ft=yaml
#
Loading