diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000..291bec3d6a --- /dev/null +++ b/.clang-format @@ -0,0 +1,44 @@ +# yaml-language-server: $schema=https://json.schemastore.org/clang-format.json +--- +BasedOnStyle: LLVM +ColumnLimit: 100 +IndentWidth: 4 +UseTab: Never +--- +Language: Cpp +AlignAfterOpenBracket: BlockIndent +AlignArrayOfStructures: Left +AlignConsecutiveAssignments: Consecutive +AlignConsecutiveBitFields: Consecutive +AlignConsecutiveDeclarations: + Enabled: false +AlignConsecutiveMacros: Consecutive +AlignConsecutiveShortCaseStatements: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false + AlignCaseColons: false +AlignEscapedNewlines: Left +AlignOperands: Align +AlignTrailingComments: + Kind: Never +AllowAllArgumentsOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: Empty +AllowShortFunctionsOnASingleLine: None +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: true +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: false +BinPackParameters: false +BitFieldColonSpacing: Both +BreakBeforeBraces: Attach # One True Brace Style +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeComma +BreakInheritanceList: BeforeComma +Cpp11BracedListStyle: true +DerivePointerAlignment: true +FixNamespaceComments: true +NamespaceIndentation: None +SeparateDefinitionBlocks: Always +--- diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000000..44554721a5 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,32 @@ +--- +Checks: | + clang-diagnostic-*, + clang-analyzer-*, + cppcoreguidelines-*, + modernize-*, + mpi-*, + bugprone-*, + boost-*, + performance-*, + hicpp-*, + google-*, + readability-*, + misc-confusable-identifiers, + misc-const-correctness, + -modernize-use-trailing-return-type, + -cppcoreguidelines-special-member-functions +AnalyzeTemporaryDtors: false +FormatStyle: file +CheckOptions: + - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: "1" + - key: modernize-loop-convert.MaxCopySize + value: "16" + - key: modernize-loop-convert.MinConfidence + value: reasonable + - key: modernize-pass-by-value.IncludeStyle + value: google + - key: modernize-use-nullptr.NullMacros + value: "NULL" +--- + diff --git a/.gitignore b/.gitignore index 20ffa96238..ef10bce154 100644 --- a/.gitignore +++ b/.gitignore @@ -98,6 +98,7 @@ CMakeCache.txt /cmake_build /build /cmake_build* +compile_commands.json # Prevent ignoring cmake modules !cmake/**/*.cmake