Changeset: f5b3d7681a3e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/f5b3d7681a3e Added Files: .clang-format .indent.pro Branch: default Log Message:
Proposed indentation configurations for clang-format and indent. I prefer the clang-format one since it is smarter with respect to breaking long expressions. Neither one is perfect, though. diffs (273 lines): diff --git a/.clang-format b/.clang-format new file mode 100644 --- /dev/null +++ b/.clang-format @@ -0,0 +1,161 @@ +--- +IndentWidth: 8 +TabWidth: 8 +UseTab: Always +AlignAfterOpenBracket: Align +AlignArrayOfStructures: Left +AlignConsecutiveAssignments: None +AlignConsecutiveBitFields: None +AlignConsecutiveDeclarations: None +AlignConsecutiveMacros: Consecutive +AlignEscapedNewlines: LeftWithLastLine +AlignOperands: Align +AlignTrailingComments: Always +AllowAllArgumentsOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: Never +AllowShortCaseExpressionOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +# clang-format 23: AllowShortRecordOnASingleLine: Never +AlwaysBreakBeforeMultilineStrings: false +AttributeMacros: [_In_z_, _Printf_format_string_] +BinPackArguments: true +BinPackParameters: BinPack +BitFieldColonSpacing: None +BreakAdjacentStringLiterals: true +BreakAfterAttributes: Always +BreakAfterReturnType: AllDefinitions +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Linux +BreakBeforeTernaryOperators: true +BreakBinaryOperations: RespectPrecedence +BreakFunctionDefinitionParameters: false +BreakStringLiterals: false +ColumnLimit: 80 +ContinuationIndentWidth: 8 +EnumTrailingComma: Leave +ForEachMacros: + - BATloop + - TIMEOUT_LOOP_IDX + - TIMEOUT_LOOP_IDX_DECL + - TIMEOUT_LOOP +IfMacros: + - TRC_CRITICAL_IF + - TRC_ERROR_IF + - TRC_WARNING_IF + - TRC_INFO_IF + - TRC_DEBUG_IF +IncludeCategories: + - Regex: '^"monetdb_config\.h"' + - Regex: '.*' +IndentCaseBlocks: false +IndentCaseLabels: false +# clang-format 22: IndentGotoLabels: HalfIndent +IndentGotoLabels: false +IndentPPDirectives: AfterHash +InsertNewlineAtEOF: true +KeepEmptyLines: + AtEndOfFile: false + AtStartOfBlock: false + AtStartOfFile: false +LineEnding: LF +PPIndentWidth: 1 +PointerAlignment: Right +QualifierAlignment: Leave +ReflowComments: IndentOnly +SpaceAfterCStyleCast: true +SpaceAfterLogicalNot: false +SpaceAroundPointerQualifiers: Default +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeParens: ControlStatementsExceptControlMacros +SpaceBeforeSquareBrackets: false +SpaceInEmptyParentheses: false +SpacesInParens: Never +SpacesInSquareBrackets: false +StatementAttributeLikeMacros: + - fits_export + - gdk_export + - generator_export + - geom_export + - libgeom_export + - mal_export + - mapi_export + - monetdbe_export + - moptions_export + - mutils_export + - mvc_export + - netcdf_export + - orderidx_export + - pyapi_export + - shp_export + - sql5_export + - sql_export + - udf_export +TypeNames: + - allocator + - ATOMIC_BASE_TYPE + - ATOMIC_TYPE + - bat + - BAT + - BATiter + - bit + - bte + - BUN + - BUN2type + - BUN4type + - BUN8type + - date + - daytime + - dbl + - FILE + - flt + - gdk_callback_func + - gdk_return + - Hash + - Heap + - hge + - __int128_t + - int16_t + - int32_t + - int64_t + - int8_t + - lng + - log_bid + - logger + - log_id + - Mapi + - MapiHdl + - MapiMsg + - msk + - MT_Cond + - MT_Id + - MT_Lock + - MT_Sema + - off_t + - oid + - old_logger + - PROPrec + - ptr + - QryCtx + - RTree + - sht + - str + - stream + - stridx_t + - Strimps + - timestamp + - time_t + - trans + - uint16_t + - uint32_t + - uint64_t + - uint8_t + - ulng + - url + - ValRecord + - var_t diff --git a/.indent.pro b/.indent.pro new file mode 100644 --- /dev/null +++ b/.indent.pro @@ -0,0 +1,102 @@ +--no-blank-before-sizeof +--no-blank-lines-after-commas +--no-blank-lines-after-declarations +--blank-lines-after-procedures +--braces-after-func-def-line +--braces-on-if-line +--braces-on-struct-decl-line +--break-after-boolean-operator +--case-brace-indentation0 +--case-indentation0 +--no-comment-delimiters-on-blank-lines +--comment-indentation33 +--continuation-indentation8 +--continue-at-parentheses +--cuddle-do-while +--cuddle-else +--declaration-comment-column33 +--declaration-indentation1 +--dont-format-comments +--dont-format-first-column-comments +--dont-star-comments +--else-endif-column1 +--ignore-newlines +--indent-label2 +--indent-level8 +--leave-preprocessor-space +--line-comments-indentation0 +--line-length80 +--parameter-indentation0 +--pointer-align-right +--procnames-start-lines +--space-after-cast +--space-after-for +--no-space-after-function-call-names +--space-after-if +--no-space-after-parentheses +--space-after-while +--space-special-semicolon +--tab-size8 +--use-tabs +-T allocator +-T ATOMIC_BASE_TYPE +-T ATOMIC_TYPE +-T bat +-T BAT +-T BATiter +-T bit +-T bte +-T BUN +-T BUN2type +-T BUN4type +-T BUN8type +-T date +-T daytime +-T dbl +-T FILE +-T flt +-T gdk_callback_func +-T gdk_return +-T Hash +-T Heap +-T hge +-T __int128_t +-T int16_t +-T int32_t +-T int64_t +-T int8_t +-T lng +-T log_bid +-T logger +-T log_id +-T Mapi +-T MapiHdl +-T MapiMsg +-T msk +-T MT_Cond +-T MT_Id +-T MT_Lock +-T MT_Sema +-T off_t +-T oid +-T old_logger +-T PROPrec +-T ptr +-T QryCtx +-T RTree +-T sht +-T str +-T stream +-T stridx_t +-T Strimps +-T timestamp +-T time_t +-T trans +-T uint16_t +-T uint32_t +-T uint64_t +-T uint8_t +-T ulng +-T url +-T ValRecord +-T var_t _______________________________________________ checkin-list mailing list -- [email protected] To unsubscribe send an email to [email protected]
