Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
BasedOnStyle: LLVM
AccessModifierOffset: -1
AlignArrayOfStructures: Right
AlwaysBreakTemplateDeclarations: Yes
BreakConstructorInitializers: BeforeColon
BreakConstructorInitializersBeforeComma: true
BreakInheritanceList: BeforeComma
BreakBeforeInheritanceComma: true
EmptyLineBeforeAccessModifier: Always
IncludeBlocks: Regroup
IndentCaseLabels: true
InsertBraces: true
InsertNewlineAtEOF: true
IntegerLiteralSeparator:
Binary: 4
Decimal: 3
Hex: 2
KeepEmptyLinesAtTheStartOfBlocks: false
LineEnding: LF
PointerAlignment: Left
QualifierAlignment: Custom
QualifierOrder: ['inline', 'static', 'constexpr', 'type', 'const', 'volatile']
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
ShortNamespaceLines: 8
SpacesBeforeTrailingComments: 2
UseCRLF: false
UseTab: Never
DisableFormat: true
...
125 changes: 125 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# check options see https://clang.llvm.org/extra/clang-tidy/checks/list.html

Checks: -*,
boost-*,
bugprone-*,
-bugprone-argument-comment,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
-bugprone-parent-virtual-call,
-bugprone-swapped-arguments,
-bugprone-unsafe-functions,
cert-*,
-cert-msc50-cpp,
-cert-err58-cpp,
clang-analyzer-core.*,
clang-analyzer-cplusplus.*,
clang-analyzer-optin.cplusplus.*,
clang-analyzer-optin.performance.*,
clang-analyzer-unix.*,
clang-analyzer-valist.*,
cppcoreguidelines-avoid-capture-default-when-capturing-this,
cppcoreguidelines-prefer-member-initializer,
cppcoreguidelines-slicing,
cppcoreguidelines-special-member-functions,
cppcoreguidelines-virtual-class-destructor,
google-*,
-google-objc-*,
-google-readability-avoid-underscore-in-googletest-name,
-google-runtime-references,
-google-upgrade-googletest-case,
misc-*,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,
-modernize-deprecated-headers,
-modernize-use-nodiscard,
performance-*,
readability-*,
-readability-convert-member-functions-to-static,
-readability-inconsistent-declaration-parameter-name,
-readability-magic-numbers,
-readability-suspicious-call-argument,
-readability-uppercase-literal-suffix,

WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: none

CheckOptions:
- key: bugprone-suspicious-include.HeaderFileExtensions
value: ';h;hh;hpp;hxx;tcc;inc;def'
- key: google-build-namespaces.HeaderFileExtensions
value: 'h,hh,hpp,hxx,tcc,'
- key: google-global-names-in-headers.HeaderFileExtensions
value: 'h,hh,hpp,hxx,tcc,'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '8'
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: 'true'
- key: misc-uniqueptr-reset-release.IncludeStyle
value: llvm
- key: modernize-loop-convert.MaxCopySize
value: '8'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-use-emplace.IgnoreImplicitConstructors
value: 'true'
- key: modernize-use-override.IgnoreDestructors
value: 'true'
# SEE: https://clang.llvm.org/extra/clang-tidy/checks/readability-function-cognitive-complexity.html
- key: readability-function-cognitive-complexity.Threshold
value: '25'
- key: readability-function-size.LineThreshold
value: '64'
- key: readability-function-size.StatementThreshold
value: '500'
- key: readability-identifier-length.MinimumVariableNameLength
value: '2'
- key: readability-identifier-length.MinimumParameterNameLength
value: '2'
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.ClassMemberCase
value: lower_case
- key: readability-identifier-naming.ClassMemberSuffix
value: _
- key: readability-identifier-naming.ConstantCase
value: CamelCase
- key: readability-identifier-naming.ConstantPrefix
value: k
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantPrefix
value: k
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
- key: readability-identifier-naming.PrivateMemberSuffix
value: _
- key: readability-identifier-naming.ProtectedMemberSuffix
value: _
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.TemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TypeTemplateParameterIgnoredRegexp
value: expr-type
- key: readability-implicit-bool-conversion.AllowIntegerConditions
value: 'true'
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: 'true'
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
root = true

[*]
charset = utf-8
curly_bracket_next_line = false
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
quote_type = double
spaces_around_operators = true
tab_width = 4
trim_trailing_whitespace = true

[*.sh]
indent_size = 4
max_line_length = 120

[*.{c,h}]
indent_size = 8

[Makefile]
indent_style = tab
max_line_length = 120

[*.{sln,vcxproj,vcproj,xproj,props,vcxitems}]
end_of_line = crlf

[*.md]
trim_trailing_whitespace = false
40 changes: 40 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
######################### C #########################
*.c text eol=lf diff=c encoding
*.h text eol=lf diff=c encoding


######################### C++ #########################
*.cc text eol=lf diff=cpp encoding
*.cxx text eol=lf diff=cpp encoding
*.cpp text eol=lf diff=cpp encoding
*.c++ text eol=lf diff=cpp encoding
*.hh text eol=lf diff=cpp encoding
*.hxx test eol=lf diff=cpp encoding
*.hpp text eol=lf diff=cpp encoding
*.h++ text eol=lf diff=cpp encoding
*.tcc text eol=lf diff=cpp encoding


######################### CMake #########################
*.cmake text eol=lf encoding
CMakeLists.txt text eol=lf encoding


######################### VisualStudio #########################
*.sln text eol=crlf
*.csproj text eol=crlf
*.vbproj text eol=crlf
*.vcxproj text eol=crlf
*.vcproj text eol=crlf
*.dbproj text eol=crlf
*.fsproj text eol=crlf
*.lsproj text eol=crlf
*.wixproj text eol=crlf
*.modelproj text eol=crlf
*.sqlproj text eol=crlf
*.wwaproj text eol=crlf

*.xproj text eol=crlf
*.props text eol=crlf
*.filters text eol=crlf
*.vcxitems text eol=crlf
Loading