Skip to content

Commit

Permalink
Added formatting files
Browse files Browse the repository at this point in the history
  • Loading branch information
marip8 committed Apr 6, 2022
1 parent 100a456 commit da8df58
Show file tree
Hide file tree
Showing 5 changed files with 484 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
BasedOnStyle: Google
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 2
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: false
PointerBindsToType: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 60
PenaltyBreakString: 1
PenaltyBreakFirstLessLess: 1000
PenaltyExcessCharacter: 1000
PenaltyReturnTypeOnItsOwnLine: 90
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: false
Standard: Auto
IndentWidth: 2
TabWidth: 2
UseTab: Never
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
SortIncludes: false
SpaceAfterCStyleCast: false

# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom

# Control of individual brace wrapping cases
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
AfterFunction : 'true'
AfterNamespace : 'true'
AfterStruct : 'true'
AfterUnion : 'true'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
}
...
68 changes: 68 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
Checks: >
-*,
clang-diagnostic-*,
-clang-diagnostic-unknown-warning-option,
clang-analyzer-*,
-clang-analyzer-cplusplus*,
bugprone-*,
cppcoreguidelines-*,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-non-private-member-variables-in-classes,
misc-*,
-misc-non-private-member-variables-in-classes,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
performance-*,
readability-*,
-readability-braces-around-statements,
-readability-named-parameter,
-readability-magic-numbers,
-readability-isolate-declaration
WarningsAsErrors: >
-*,
clang-diagnostic-*,
-clang-diagnostic-unknown-warning-option,
clang-analyzer-*,
-clang-analyzer-cplusplus*,
bugprone-*,
cppcoreguidelines-*,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-non-private-member-variables-in-classes,
misc-*,
-misc-non-private-member-variables-in-classes,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
performance-*,
readability-*,
-readability-braces-around-statements,
-readability-named-parameter,
-readability-magic-numbers,
-readability-isolate-declaration
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
FormatStyle: none
CheckOptions:
- key: modernize-use-override.AllowOverrideAndFinal
value: '1'
- key: cppcoreguidelines-explicit-virtual-functions.AllowOverrideAndFinal
value: '1'
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
value: '1'
...
Loading

0 comments on commit da8df58

Please sign in to comment.