diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..7b6699da --- /dev/null +++ b/.clang-format @@ -0,0 +1,33 @@ +--- +BasedOnStyle: LLVM +Standard: c++14 + +AllowShortFunctionsOnASingleLine: All +AllowShortLambdasOnASingleLine: All +AlwaysBreakAfterReturnType: TopLevelDefinitions +BinPackArguments: false +BinPackParameters: false +BreakConstructorInitializers: AfterColon +BreakStringLiterals: false +ColumnLimit: 130 +ContinuationIndentWidth: 2 +IndentCaseLabels: false +IndentWidth: 2 +PenaltyReturnTypeOnItsOwnLine: 130 +PointerAlignment: Left + +AlignEscapedNewlines: Right +AlignConsecutiveDeclarations: + Enabled: true + AcrossEmptyLines: true + AcrossComments: false +AlignConsecutiveMacros: + Enabled: true +AlignConsecutiveAssignments: + Enabled: true + +IncludeCategories: + - Regex: "^(config|globals)\\.h" + Priority: -1 + - Regex: "^torrent/.*" + Priority: 1 diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 00000000..cc775ab6 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,16 @@ +--- +Checks: '-*,bugprone-*,readability-identifier-naming,performance-for-range-copy' +FormatStyle: 'file' +CheckOptions: + - key: readability-identifier-naming.LocalVariableCase + value: lower_case + - key: readability-identifier-naming.ParameterCase + value: lower_case + - key: readability-identifier-naming.FunctionCase + value: lower_case + - key: readability-identifier-naming.PrivateMemberPrefix + value: m_ + - key: readability-identifier-naming.PrivateMemberCase + value: camelBack + - key: readability-identifier-naming.ClassConstantCase + value: lower_case