diff --git a/tools/.clang-format b/tools/.clang-format new file mode 100644 index 00000000..9414f657 --- /dev/null +++ b/tools/.clang-format @@ -0,0 +1,76 @@ +--- +BasedOnStyle: LLVM +IndentWidth: 2 +TabWidth: 2 +UseTab: Never + + +# General formatting +AccessModifierOffset: -2 +MaxEmptyLinesToKeep: 1 +# BreakBeforeBraces: Allman + +# Line length +ColumnLimit: 80 + +# Bracing style +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: true + AfterControlStatement: Never + AfterFunction: true + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: false + +# Use of spaces +SpacesBeforeTrailingComments: 1 +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false + +# Use of comments +CommentPragmas: "^ IWYU pragma:" + +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: true +AlignConsecutiveMacros: true +AlignEscapedNewlines: Right +AlignOperands: true +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: Empty +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Empty +AllowShortLoopsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: No +BinPackArguments: false +BinPackParameters: false +BreakBeforeBinaryOperators: NonAssignment +BreakBeforeTernaryOperators: true +BreakStringLiterals: true +Cpp11BracedListStyle: true +IncludeBlocks: Regroup +IndentCaseLabels: true +IndentGotoLabels: false +IndentPPDirectives: None +IndentWrappedFunctionNames: true +KeepEmptyLinesAtTheStartOfBlocks: false +PointerAlignment: Right +ReflowComments: false +SortIncludes: false +SpaceAfterCStyleCast: true +SpaceAfterLogicalNot: false +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false +SpacesInCStyleCastParentheses: false +SpacesInConditionalStatement: false +SpacesInContainerLiterals: false diff --git a/tools/.clang-tidy b/tools/.clang-tidy new file mode 100644 index 00000000..33711ca8 --- /dev/null +++ b/tools/.clang-tidy @@ -0,0 +1,50 @@ +Checks: > + -*, + readability-identifier-naming, + readability-magic-numbers, + readability-braces-around-statements + +WarningsAsErrors: > + readability-identifier-naming, + readability-magic-numbers, + readability-braces-around-statements + +HeaderFilterRegex: '' +FormatStyle: none +InheritParentConfig: true +User: user +CheckOptions: + - key: readability-identifier-naming.VariableCase + value: lower_case + - key: readability-identifier-naming.GlobalConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.GlobalConstantPrefix + value: SL_ + - key: readability-identifier-naming.ConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.ConstantPrefix + value: SL_ + - key: readability-identifier-naming.EnumConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.EnumConstantPrefix + value: SL_ + - key: readability-identifier-naming.EnumCase + value: lower_case + - key: readability-identifier-naming.EnumPrefix + value: sl_ + - key: readability-identifier-naming.FunctionIgnoredRegexp + value: 'sli_.*' + - key: readability-identifier-naming.FunctionCase + value: lower_case + - key: readability-identifier-naming.FunctionPrefix + value: 'sl_' + - key: readability-identifier-naming.StructCase + value: lower_case + - key: readability-identifier-naming.StructPrefix + value: 'sl_' + - key: readability-identifier-naming.StructMemberCase + value: lower_case + - key: readability-identifier-naming.TypedefCase + value: lower_case + - key: readability-identifier-naming.TypedefPrefix + value: 'sl_'