Skip to content

Commit b1febde

Browse files
committed
chore: add .clang-format
1 parent fb4bdf6 commit b1febde

139 files changed

Lines changed: 24324 additions & 25382 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
BasedOnStyle: LLVM
2+
AccessModifierOffset: -4
3+
AlignAfterOpenBracket: BlockIndent
4+
AlignArrayOfStructures: Left
5+
AlignConsecutiveDeclarations:
6+
Enabled: true
7+
AcrossEmptyLines: false
8+
AcrossComments: false
9+
AlignConsecutiveAssignments:
10+
Enabled: true
11+
AcrossEmptyLines: false
12+
AcrossComments: false
13+
AlignCompound: true
14+
PadOperators: true
15+
AlignConsecutiveMacros:
16+
Enabled: true
17+
AcrossEmptyLines: false
18+
AcrossComments: false
19+
AllowAllParametersOfDeclarationOnNextLine: false
20+
AllowAllArgumentsOnNextLine: false
21+
AlignOperands: AlignAfterOperator
22+
AlignConsecutiveBitFields:
23+
Enabled: true
24+
AcrossEmptyLines: false
25+
AcrossComments: false
26+
AllowShortLambdasOnASingleLine: All
27+
AllowShortBlocksOnASingleLine: Empty
28+
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
29+
AllowShortLoopsOnASingleLine: true
30+
AlwaysBreakAfterDefinitionReturnType: None
31+
AlwaysBreakTemplateDeclarations: 'Yes'
32+
BinPackArguments: false
33+
BinPackParameters: false
34+
BreakBeforeBraces: Custom
35+
BreakBeforeBinaryOperators: NonAssignment
36+
ColumnLimit: 120
37+
CommentPragmas: '^ IWYU pragma:'
38+
ConstructorInitializerIndentWidth: 0
39+
IndentWidth: 4
40+
Language: Cpp
41+
MaxEmptyLinesToKeep: 2
42+
PackConstructorInitializers: CurrentLine
43+
PointerAlignment: Left
44+
TabWidth: 4
45+
UseTab: Never
46+
SortIncludes: CaseSensitive

.clang-tidy

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Generated from CLion Inspection settings
2+
---
3+
Checks: '-*,
4+
bugprone-argument-comment,
5+
bugprone-assert-side-effect,
6+
bugprone-bad-signal-to-kill-thread,
7+
bugprone-branch-clone,
8+
bugprone-copy-constructor-init,
9+
bugprone-dangling-handle,
10+
bugprone-dynamic-static-initializers,
11+
bugprone-fold-init-type,
12+
bugprone-forward-declaration-namespace,
13+
bugprone-forwarding-reference-overload,
14+
bugprone-inaccurate-erase,
15+
bugprone-incorrect-roundings,
16+
bugprone-integer-division,
17+
bugprone-lambda-function-name,
18+
bugprone-macro-parentheses,
19+
bugprone-macro-repeated-side-effects,
20+
bugprone-misplaced-operator-in-strlen-in-alloc,
21+
bugprone-misplaced-pointer-arithmetic-in-alloc,
22+
bugprone-misplaced-widening-cast,
23+
bugprone-move-forwarding-reference,
24+
bugprone-multiple-statement-macro,
25+
bugprone-no-escape,
26+
bugprone-not-null-terminated-result,
27+
bugprone-parent-virtual-call,
28+
bugprone-posix-return,
29+
bugprone-reserved-identifier,
30+
bugprone-sizeof-container,
31+
bugprone-sizeof-expression,
32+
bugprone-spuriously-wake-up-functions,
33+
bugprone-string-constructor,
34+
bugprone-string-integer-assignment,
35+
bugprone-string-literal-with-embedded-nul,
36+
bugprone-suspicious-enum-usage,
37+
bugprone-suspicious-include,
38+
bugprone-suspicious-memory-comparison,
39+
bugprone-suspicious-memset-usage,
40+
bugprone-suspicious-missing-comma,
41+
bugprone-suspicious-semicolon,
42+
bugprone-suspicious-string-compare,
43+
bugprone-swapped-arguments,
44+
bugprone-terminating-continue,
45+
bugprone-throw-keyword-missing,
46+
bugprone-too-small-loop-variable,
47+
bugprone-undefined-memory-manipulation,
48+
bugprone-undelegated-constructor,
49+
bugprone-unhandled-self-assignment,
50+
bugprone-unused-raii,
51+
bugprone-unused-return-value,
52+
bugprone-use-after-move,
53+
bugprone-virtual-near-miss,
54+
cert-dcl21-cpp,
55+
cert-dcl58-cpp,
56+
cert-err34-c,
57+
cert-err52-cpp,
58+
cert-err60-cpp,
59+
cert-flp30-c,
60+
cert-msc50-cpp,
61+
cert-msc51-cpp,
62+
cert-str34-c,
63+
cppcoreguidelines-interfaces-global-init,
64+
cppcoreguidelines-narrowing-conversions,
65+
cppcoreguidelines-pro-type-member-init,
66+
cppcoreguidelines-slicing,
67+
google-default-arguments,
68+
google-explicit-constructor,
69+
google-runtime-operator,
70+
hicpp-exception-baseclass,
71+
hicpp-multiway-paths-covered,
72+
misc-misplaced-const,
73+
misc-new-delete-overloads,
74+
misc-non-copyable-objects,
75+
misc-throw-by-value-catch-by-reference,
76+
misc-unconventional-assign-operator,
77+
misc-uniqueptr-reset-release,
78+
modernize-avoid-bind,
79+
modernize-concat-nested-namespaces,
80+
modernize-deprecated-headers,
81+
modernize-deprecated-ios-base-aliases,
82+
modernize-loop-convert,
83+
modernize-make-shared,
84+
modernize-make-unique,
85+
modernize-pass-by-value,
86+
modernize-raw-string-literal,
87+
modernize-redundant-void-arg,
88+
modernize-replace-auto-ptr,
89+
modernize-replace-disallow-copy-and-assign-macro,
90+
modernize-replace-random-shuffle,
91+
modernize-return-braced-init-list,
92+
modernize-shrink-to-fit,
93+
modernize-unary-static-assert,
94+
modernize-use-auto,
95+
modernize-use-bool-literals,
96+
modernize-use-emplace,
97+
modernize-use-equals-default,
98+
modernize-use-equals-delete,
99+
modernize-use-nodiscard,
100+
modernize-use-noexcept,
101+
modernize-use-nullptr,
102+
modernize-use-override,
103+
modernize-use-transparent-functors,
104+
modernize-use-uncaught-exceptions,
105+
mpi-buffer-deref,
106+
mpi-type-mismatch,
107+
openmp-use-default-none,
108+
performance-faster-string-find,
109+
performance-for-range-copy,
110+
performance-implicit-conversion-in-loop,
111+
performance-inefficient-algorithm,
112+
performance-inefficient-string-concatenation,
113+
performance-inefficient-vector-operation,
114+
performance-move-const-arg,
115+
performance-move-constructor-init,
116+
performance-no-automatic-move,
117+
performance-noexcept-move-constructor,
118+
performance-trivially-destructible,
119+
performance-type-promotion-in-math-fn,
120+
performance-unnecessary-copy-initialization,
121+
performance-unnecessary-value-param,
122+
portability-simd-intrinsics,
123+
readability-avoid-const-params-in-decls,
124+
readability-const-return-type,
125+
readability-container-size-empty,
126+
readability-convert-member-functions-to-static,
127+
readability-delete-null-pointer,
128+
readability-deleted-default,
129+
readability-inconsistent-declaration-parameter-name,
130+
readability-make-member-function-const,
131+
readability-misleading-indentation,
132+
readability-misplaced-array-index,
133+
readability-non-const-parameter,
134+
readability-redundant-control-flow,
135+
readability-redundant-declaration,
136+
readability-redundant-function-ptr-dereference,
137+
readability-redundant-smartptr-get,
138+
readability-redundant-string-cstr,
139+
readability-redundant-string-init,
140+
readability-simplify-subscript-expr,
141+
readability-static-accessed-through-instance,
142+
readability-static-definition-in-anonymous-namespace,
143+
readability-string-compare,
144+
readability-uniqueptr-delete-release,
145+
readability-use-anyofallof'

.clangd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ CompileFlags:
88
Add:
99
- "-ferror-limit=0"
1010
- "-D__FUNCTION__=\"dummy\""
11+
- "-Yumc/_HeaderOutputPredefine.h"
12+
- "-FImc/_HeaderOutputPredefine.h" # clangd bug can't find pch file
13+
Remove:
14+
- "/Yu_HeaderOutputPredefine.h"
15+
- "/FI_HeaderOutputPredefine.h"

.gitattributes

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,90 @@
1-
## C++
1+
## https://github.com/gitattributes/gitattributes/blob/master/Common.gitattributes
2+
# Common settings that generally should always be used with your language specific settings
3+
4+
# Auto detect text files and perform LF normalization
5+
* text=auto
6+
7+
#
8+
# The above will handle all files NOT found below
9+
#
10+
11+
# Documents
12+
*.bibtex text diff=bibtex
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain
23+
*.md text diff=markdown
24+
*.mdx text diff=markdown
25+
*.tex text diff=tex
26+
*.adoc text
27+
*.textile text
28+
*.mustache text
29+
*.csv text eol=crlf
30+
*.tab text
31+
*.tsv text
32+
*.txt text
33+
*.sql text
34+
*.epub diff=astextplain
35+
36+
# Graphics
37+
*.png binary
38+
*.jpg binary
39+
*.jpeg binary
40+
*.gif binary
41+
*.tif binary
42+
*.tiff binary
43+
*.ico binary
44+
# SVG treated as text by default.
45+
*.svg text
46+
# If you want to treat it as binary,
47+
# use the following line instead.
48+
# *.svg binary
49+
*.eps binary
50+
51+
# Scripts
52+
*.bash text eol=lf
53+
*.fish text eol=lf
54+
*.sh text eol=lf
55+
*.zsh text eol=lf
56+
# These are explicitly windows files and should use crlf
57+
*.bat text eol=crlf
58+
*.cmd text eol=crlf
59+
*.ps1 text eol=crlf
60+
61+
# Serialisation
62+
*.json text
63+
*.toml text
64+
*.xml text
65+
*.yaml text
66+
*.yml text
67+
68+
# Archives
69+
*.7z binary
70+
*.gz binary
71+
*.tar binary
72+
*.tgz binary
73+
*.zip binary
74+
75+
# Text files where line endings should be preserved
76+
*.patch -text
77+
78+
#
79+
# Exclude files from exporting
80+
#
81+
82+
.gitattributes export-ignore
83+
.gitignore export-ignore
84+
.gitkeep export-ignore
85+
86+
87+
## https://github.com/gitattributes/gitattributes/blob/master/C%2B%2B.gitattributes
288
# Sources
389
*.c text diff=cpp
490
*.cc text diff=cpp
@@ -38,4 +124,4 @@
38124
*.app binary
39125

40126

41-
## Others
127+
## Project specific

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jobs:
99
matrix:
1010
backend:
1111
- lua
12-
- nodejs
13-
- python310
14-
- quickjs
12+
# - nodejs
13+
# - python310
14+
# - quickjs
1515
runs-on: windows-latest
1616
steps:
1717
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)