Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
Signed-off-by: msclock <msclock@qq.com>
  • Loading branch information
msclock committed Apr 10, 2024
0 parents commit 56fecf6
Show file tree
Hide file tree
Showing 190 changed files with 11,621 additions and 0 deletions.
228 changes: 228 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
---
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
Language: Cpp
# Do not offset access specifiers (public, protected, private)
AccessModifierOffset: -4
# Align parameters after opening brackets (round, angle, square)
AlignAfterOpenBracket: Align
# Do not align consecutive assignments
AlignConsecutiveAssignments: false
# Do not align consecutive declarations
AlignConsecutiveDeclarations: false
# Align consecutive macros
AlignConsecutiveMacros: true
# Align escaped newlines to the left
AlignEscapedNewlines: Left
# Align operands of binary and ternary expressions horizontally
AlignOperands: true
# Align trailing comments
AlignTrailingComments: true
# Allow all function arguments on the next line
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
# Do not allow short blocks (e.g., while blocks) on a single line
AllowShortBlocksOnASingleLine: false
# Do not allow short case labels on a single line
AllowShortCaseLabelsOnASingleLine: false
# Do not allow non-empty functions defined outside of a class on a single line
AllowShortFunctionsOnASingleLine: Inline
# Do not allow short if statements on a single line
AllowShortIfStatementsOnASingleLine: false
# Do not allow short loop blocks on a single line
AllowShortLoopsOnASingleLine: false
# Do not break after the return type in function definitions, unless it exceeds the column limit
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
# Do not break before multiline strings
AlwaysBreakBeforeMultilineStrings: false
# Always break after template declarations
AlwaysBreakTemplateDeclarations: Yes
# Do not require each function argument to be on a separate line
BinPackArguments: false
# Do not require each function parameter to be on a separate line
BinPackParameters: false
# Configure brace wrapping style
BraceWrapping:
# Do not break after case labels
AfterCaseLabel: false
# Do not break after class definitions
AfterClass: false
# Do not break after control statements
AfterControlStatement: false
# Do not break after enum definitions
AfterEnum: false
# Do not break after function definitions
AfterFunction: false
# Do not break after namespace definitions
AfterNamespace: false
# Do not break after struct definitions
AfterStruct: false
# Do not break after union definitions
AfterUnion: false
# Do not break after extern blocks
AfterExternBlock: false
# Break before catch statements
BeforeCatch: true
# Break before else statements
BeforeElse: true
# Do not break before lambda bodies
BeforeLambdaBody: false
# Break before while statements
BeforeWhile: true
# Do not indent braces
IndentBraces: false
# Allow empty function bodies on a single line
SplitEmptyFunction: false
# Allow empty statements on a single line
SplitEmptyRecord: false
# Allow empty namespaces on a single line
SplitEmptyNamespace: false
# Break before binary operators, except for assignment operators
BreakBeforeBinaryOperators: NonAssignment
# Customize break before braces in BraceWrapping
BreakBeforeBraces: Custom
# Do not break after commas in inheritance lists
BreakBeforeInheritanceComma: false
# Break before colons in inheritance lists, but not before commas
BreakInheritanceList: BeforeColon
# Break before ternary operators
BreakBeforeTernaryOperators: true
# Do not break after commas in constructor initializer lists
BreakConstructorInitializersBeforeComma: false
# Break before colons in constructor initializer lists, but not before commas
BreakConstructorInitializers: BeforeColon
# Allow breaking string literals
BreakStringLiterals: true
# Column limit for each line
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
# Do not allow different namespaces to be defined on the same line
CompactNamespaces: false
# Constructor initializer lists should either be all on one line or one per line
ConstructorInitializerAllOnOneLineOrOnePerLine: true
# Indent constructor initializer lists by 4 spaces
ConstructorInitializerIndentWidth: 4
# Indent continuation lines by 4 spaces
ContinuationIndentWidth: 4
# No spaces around variable initialization lists
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
# Automatically add comments at the end of namespaces
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: ^<ext/.*\.h>
Priority: 2
- Regex: StdAfx.h
Priority: -1
- Regex: ^<.*\.h>
Priority: 1
- Regex: ^<.*
Priority: 2
- Regex: .*
Priority: 3
IncludeIsMainRegex: ([-_](test|unittest))?$
# Indent case labels inside switch statements
IndentCaseLabels: true
# Indent code blocks inside extern blocks
IndentExternBlock: Indent
# Do not indent preprocessor directives
IndentPPDirectives: None
# Use 4 spaces for indentation
IndentWidth: 4
# Do not indent wrapped function names after the return type
IndentWrappedFunctionNames: false
# Do not keep empty lines at the start of code blocks
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
# Do not allow consecutive empty lines
MaxEmptyLinesToKeep: 1
# Do not indent contents inside namespaces
NamespaceIndentation: None
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
# * and & should be placed next to the type name
PointerAlignment: Left
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- c++
- C++
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
CanonicalDelimiter: ''
BasedOnStyle: google
# Allow reflowing of comments
ReflowComments: true
# Allow sorting of #include statements
SortIncludes: true
# Allow sorting of using declarations
SortUsingDeclarations: true
# Do not include spaces after C-style casts
SpaceAfterCStyleCast: false
# Require a space after the template keyword
SpaceAfterTemplateKeyword: true
# Require spaces around assignment operators
SpaceBeforeAssignmentOperators: true
# Do not include spaces before C++11 braced initializer lists
SpaceBeforeCpp11BracedList: false
# Require a space before the colon in constructor initializers
SpaceBeforeCtorInitializerColon: true
# Require a space before the colon in inheritance statements
SpaceBeforeInheritanceColon: true
# Require a space after control statement keywords (if, for, while, etc.)
SpaceBeforeParens: ControlStatements
# Require a space before the colon in range-based for loops
SpaceBeforeRangeBasedForLoopColon: true
# Do not include spaces inside empty parentheses
SpaceInEmptyParentheses: false
# Require a space before // in trailing comments
SpacesBeforeTrailingComments: 1
# Do not include spaces around angle brackets
SpacesInAngles: false
# Do not include spaces around C-style cast parentheses
SpacesInCStyleCastParentheses: false
# Do not include spaces around parentheses
SpacesInParentheses: false
# Do not include spaces around square brackets
SpacesInSquareBrackets: false
Standard: Auto
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseTab: Never
78 changes: 78 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
Checks: >
*,
-abseil-*,
-altera-*,
-android-*,
-boost-*,
-cert-*,
-cppcoreguidelines-*,
-darwin-*,
-fuchsia-*,
-google-*,
-hicpp-*,
-linuxkernel-*,
-llvm-*,
-llvmlibc-*,
-mpi-*,
-objc-*,
-openmp-*,
-zircon-*,
cert-err34-c,
google-explicit-constructor,
cppcoreguidelines-rvalue-reference-param-not-moved,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-empty-catch,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-signed-char-misuse,
-bugprone-switch-missing-default-case,
-bugprone-unchecked-optional-access,
-clang-analyzer-*,
-concurrency-mt-unsafe,
-misc-const-correctness,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-throw-by-value-catch-by-reference,
-misc-use-anonymous-namespace,
-misc-include-cleaner,
-misc-unused-using-decls,
-modernize-avoid-c-arrays,
-modernize-deprecated-ios-base-aliases,
-modernize-loop-convert,
-modernize-macro-to-enum,
-modernize-raw-string-literal,
-modernize-replace-auto-ptr,
-modernize-return-braced-init-list,
-modernize-type-traits,
-modernize-use-auto,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-modernize-concat-nested-namespaces,
-performance-avoid-endl,
-performance-enum-size,
-performance-inefficient-string-concatenation,
-performance-no-automatic-move,
-performance-noexcept-swap,
-portability-simd-intrinsics,
-portability-std-allocator-const,
-readability-avoid-const-params-in-decls,
-readability-avoid-nested-conditional-operator,
-readability-braces-around-statements,
-readability-container-data-pointer,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
-readability-identifier-naming,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-suspicious-call-argument,
-readability-uppercase-literal-suffix
HeaderFilterRegex: (src)\/[a-z]+\.hpp
CheckOptions:
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
- key: readability-simplify-boolean-expr.SimplifyDeMorgan
value: '0'
2 changes: 2 additions & 0 deletions .cppcheck-suppressions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Limit analysis of branches. Use --check-level=exhaustive to analyze all branches.
normalCheckLevelMaxBranches
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/devcontainers/images/tree/main/src/base-ubuntu
{
"name": "ss-pybind11",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",
"capAdd": [
// Enable ptrace-based debugging for C++
"SYS_PTRACE"
],
"securityOpt": [
"seccomp=unconfined"
],
// https://github.com/devcontainers/features
// Using features in vscode requires access github with uncomment the below
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"username": "vscode"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/python:1": {},
"ghcr.io/msclock/features/vcpkg:2": {}
},
"customizations": {
"vscode": {
"extensions": [
"EditorConfig.EditorConfig",
"mhutchie.git-graph",
"ms-vscode.cmake-tools"
]
}
},
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": {
"git-completions": "echo 'source /usr/share/bash-completion/completions/git' >> ~/.bashrc"
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "vscode"
}
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EditorConfig is awesome: https://EditorConfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,yaml,json,toml,jinja,css,js,cmake}]
indent_size = 2

[CMakeLists.txt]
indent_size = 2

[Makefile]
indent_style = tab
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Keep compatilibity between windows and unix-like OS
* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf

# Archive Format
*.tar.gz filter=lfs diff=lfs merge=lfs -text
12 changes: 12 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
codecov:
notify:
after_n_builds: 1
coverage:
status:
project:
default:
target: auto
threshold: 5%
patch:
default:
informational: true
6 changes: 6 additions & 0 deletions .github/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: CodeQL config

# https://codeql.github.com/codeql-query-help/
query-filters:
- exclude:
id: py/commented-out-code
Loading

0 comments on commit 56fecf6

Please sign in to comment.