Skip to content
Open
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
38 changes: 38 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
Language: Cpp
BasedOnStyle: LLVM
DisableFormat: false
AccessModifierOffset: -1
AlignArrayOfStructures: Right
AllowShortCaseLabelsOnASingleLine: false
AllowShortCompoundRequirementOnASingleLine: true
AlwaysBreakTemplateDeclarations: MultiLine
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeComma
BreakTemplateDeclarations: MultiLine
EmptyLineBeforeAccessModifier: Always
IncludeBlocks: Regroup
IndentCaseLabels: false
InsertBraces: true
InsertNewlineAtEOF: true
IntegerLiteralSeparator:
Binary: 4
Decimal: 3
Hex: 4
KeepEmptyLines:
AtEndOfFile: false
AtStartOfBlock: false
AtStartOfFile: false
KeepEmptyLinesAtEOF: false
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
...
96 changes: 96 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
# check options see https://clang.llvm.org/extra/clang-tidy/checks/list.html

Checks: >
-*,
boost-*,
bugprone-*,
-bugprone-argument-comment,
-bugprone-easily-swappable-parameters,
-bugprone-unsafe-functions,
cert-*,
-cert-dcl58-cpp,
-cert-err52-cpp,
-cert-err58-cpp,
-cert-msc50-cpp,
concurrency-*,
clang-analyzer-core.*,
clang-analyzer-cplusplus.*,
clang-analyzer-nullability.*,
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-runtime-references,
misc-*,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-deprecated-headers,
performance-*,
readability-*,
-readability-avoid-nested-conditional-operator,
-readability-convert-member-functions-to-static,
-readability-inconsistent-declaration-parameter-name,
-readability-magic-numbers,
-readability-suspicious-call-argument,
-readability-uppercase-literal-suffix,
CheckOptions:
bugprone-suspicious-include.HeaderFileExtensions: ';h;hh;hpp;hxx;tcc;inc;def'
google-build-namespaces.HeaderFileExtensions: 'h,hh,hpp,hxx,tcc,'
google-global-names-in-headers.HeaderFileExtensions: 'h,hh,hpp,hxx,tcc,'
google-readability-namespace-comments.SpacesBeforeComments: '2'
google-readability-namespace-comments.ShortNamespaceLines: '8'
misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: 'true'
misc-uniqueptr-reset-release.IncludeStyle: llvm
modernize-loop-convert.MaxCopySize: '8'
modernize-loop-convert.MinConfidence: reasonable
modernize-pass-by-value.IncludeStyle: llvm
modernize-replace-auto-ptr.IncludeStyle: llvm
modernize-use-emplace.IgnoreImplicitConstructors: 'true'
modernize-use-override.IgnoreDestructors: 'true'
# SEE: https://clang.llvm.org/extra/clang-tidy/checks/readability-function-cognitive-complexity.html
readability-function-cognitive-complexity.Threshold: '25'
readability-function-size.LineThreshold: '64'
readability-function-size.StatementThreshold: '512'
readability-identifier-length.MinimumVariableNameLength: '2'
readability-identifier-length.MinimumParameterNameLength: '2'
readability-identifier-naming.ClassCase: CamelCase
readability-identifier-naming.ClassConstantCase: lower_case
readability-identifier-naming.ClassMemberCase: lower_case
readability-identifier-naming.ClassMethodCase: lower_case
readability-identifier-naming.ConstantCase: CamelCase
readability-identifier-naming.ConstantIgnoredRegexp: '__.*'
readability-identifier-naming.ConstantPrefix: k
readability-identifier-naming.EnumCase: CamelCase
readability-identifier-naming.EnumConstantCase: CamelCase
readability-identifier-naming.EnumConstantPrefix: k
readability-identifier-naming.FunctionCase: lower_case
readability-identifier-naming.MacroDefinitionCase: UPPER_CASE
readability-identifier-naming.MacroDefinitionIgnoredRegexp: '__.*'
readability-identifier-naming.PrivateMemberSuffix: _
readability-identifier-naming.ProtectedMemberSuffix: _
readability-identifier-naming.StaticConstantCase: lower_case
readability-identifier-naming.StructCase: CamelCase
readability-identifier-naming.TemplateParameterCase: CamelCase
readability-identifier-naming.TypeTemplateParameterIgnoredRegexp: expr-type
readability-identifier-naming.TypeAliasCase: CamelCase
readability-identifier-naming.TypeAliasIgnoredRegexp: '^(.+_)?type$|^(.+_)?pointer$|^(.+_)?reference$|^(.+_)?iterator$'
readability-identifier-naming.TypedefCase: CamelCase
readability-identifier-naming.TypedefIgnoredRegexp: '^(.+_)?type$|^(.+_)?pointer$|^(.+_)?reference$|^(.+_)?iterator$'
readability-identifier-naming.VariableCase: lower_case
readability-identifier-naming.VariableIgnoredRegexp: '__.*'
readability-implicit-bool-conversion.AllowIntegerConditions: 'true'
readability-implicit-bool-conversion.AllowPointerConditions: 'true'
FormatStyle: none
HeaderFilterRegex: '.*'
WarningsAsErrors: ''
...
50 changes: 50 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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

[*.{bat,cmd}]
end_of_line = crlf
indent_size = 4
max_line_length = 120

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

[{CMakeLists.txt,*.cmake,*.rst}]
max_line_length = 120

[{Makefile,*.{go,mk}}]
indent_style = tab
max_line_length = 120

[*.{md,markdown}]
indent_size = 2
max_line_length = 120
trim_trailing_whitespace = false

[*.ps1]
end_of_line = crlf
indent_size = 4
max_line_length = 120

[*.{py,rs}]
indent_size = 4

[*.sh]
indent_size = 4
max_line_length = 120

[*.{sln,vcxproj,vcproj,xproj,props,vcxitems,manifest}]
charset = utf-8-bom
end_of_line = crlf
45 changes: 45 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.git* export-ignore
.editorconfig export-ignore


######################### 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
*.manifest text eol=crlf
Loading