Skip to content

Commit

Permalink
feat: add .clang-* files; update .gitignore to ignore compilation db …
Browse files Browse the repository at this point in the history
…json
  • Loading branch information
program-- committed Jan 10, 2024
1 parent b357ee5 commit 9a47dd4
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# yaml-language-server: $schema=https://json.schemastore.org/clang-format.json
---
BasedOnStyle: Google
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
AllowShortIfStatementsOnASingleLine: WithoutElse
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
---
32 changes: 32 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -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"
---

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ CMakeCache.txt
/cmake_build
/build
/cmake_build*
compile_commands.json

# Prevent ignoring cmake modules
!cmake/**/*.cmake
Expand Down

0 comments on commit 9a47dd4

Please sign in to comment.