Skip to content

Commit 1535fa3

Browse files
authored
chore: merge wasm-instrumentation repo (#7)
1 parent 541736b commit 1535fa3

File tree

282 files changed

+7093
-584
lines changed

Some content is hidden

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

282 files changed

+7093
-584
lines changed

.clang-format

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: LLVM
4+
AccessModifierOffset: -2
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveMacros: false
7+
AlignConsecutiveAssignments: false
8+
AlignConsecutiveDeclarations: false
9+
AlignEscapedNewlines: Right
10+
AlignOperands: true
11+
AlignTrailingComments: true
12+
AllowAllArgumentsOnNextLine: true
13+
AllowAllConstructorInitializersOnNextLine: true
14+
AllowAllParametersOfDeclarationOnNextLine: true
15+
AllowShortBlocksOnASingleLine: false
16+
AllowShortCaseLabelsOnASingleLine: true
17+
AllowShortFunctionsOnASingleLine: None
18+
AllowShortLambdasOnASingleLine: None
19+
AllowShortIfStatementsOnASingleLine: false
20+
AllowShortLoopsOnASingleLine: false
21+
AlwaysBreakAfterDefinitionReturnType: None
22+
AlwaysBreakAfterReturnType: None
23+
AlwaysBreakBeforeMultilineStrings: false
24+
AlwaysBreakTemplateDeclarations: Yes
25+
BinPackArguments: true
26+
BinPackParameters: true
27+
BraceWrapping:
28+
AfterCaseLabel: false
29+
AfterClass: false
30+
AfterControlStatement: false
31+
AfterEnum: false
32+
AfterFunction: false
33+
AfterNamespace: false
34+
AfterObjCDeclaration: false
35+
AfterStruct: false
36+
AfterUnion: false
37+
AfterExternBlock: false
38+
BeforeCatch: false
39+
BeforeElse: false
40+
IndentBraces: false
41+
SplitEmptyFunction: true
42+
SplitEmptyRecord: true
43+
SplitEmptyNamespace: true
44+
BreakBeforeBinaryOperators: None
45+
BreakBeforeBraces: Attach
46+
BreakBeforeInheritanceComma: false
47+
BreakInheritanceList: BeforeColon
48+
BreakBeforeTernaryOperators: true
49+
BreakConstructorInitializersBeforeComma: false
50+
BreakConstructorInitializers: BeforeColon
51+
BreakAfterJavaFieldAnnotations: false
52+
BreakStringLiterals: true
53+
ColumnLimit: 100
54+
CommentPragmas: "^ IWYU pragma:"
55+
CompactNamespaces: false
56+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
57+
ConstructorInitializerIndentWidth: 4
58+
ContinuationIndentWidth: 4
59+
Cpp11BracedListStyle: true
60+
DeriveLineEnding: true
61+
DerivePointerAlignment: false
62+
DisableFormat: false
63+
ExperimentalAutoDetectBinPacking: false
64+
FixNamespaceComments: true
65+
ForEachMacros:
66+
- foreach
67+
- Q_FOREACH
68+
- BOOST_FOREACH
69+
IncludeBlocks: Preserve
70+
IncludeCategories:
71+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
72+
Priority: 2
73+
SortPriority: 0
74+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
75+
Priority: 1
76+
SortPriority: 0
77+
- Regex: ".*"
78+
Priority: 3
79+
SortPriority: 0
80+
- Regex: "^(src|wasm-compiler)/"
81+
Priority: 4
82+
SortPriority: 0
83+
IncludeIsMainRegex: "(Test)?$"
84+
IncludeIsMainSourceRegex: ""
85+
IndentCaseLabels: false
86+
IndentGotoLabels: true
87+
IndentPPDirectives: None
88+
IndentWidth: 2
89+
IndentWrappedFunctionNames: false
90+
JavaScriptQuotes: Leave
91+
JavaScriptWrapImports: true
92+
KeepEmptyLinesAtTheStartOfBlocks: true
93+
MacroBlockBegin: ""
94+
MacroBlockEnd: ""
95+
MaxEmptyLinesToKeep: 1
96+
NamespaceIndentation: None
97+
ObjCBinPackProtocolList: Auto
98+
ObjCBlockIndentWidth: 2
99+
ObjCSpaceAfterProperty: false
100+
ObjCSpaceBeforeProtocolList: true
101+
PenaltyBreakAssignment: 2
102+
PenaltyBreakBeforeFirstCallParameter: 19
103+
PenaltyBreakComment: 300
104+
PenaltyBreakFirstLessLess: 120
105+
PenaltyBreakString: 1000
106+
PenaltyBreakTemplateDeclaration: 10
107+
PenaltyExcessCharacter: 1000000
108+
PenaltyReturnTypeOnItsOwnLine: 60
109+
PointerAlignment: Right
110+
ReflowComments: true
111+
SortIncludes: true
112+
SortUsingDeclarations: true
113+
SpaceAfterCStyleCast: false
114+
SpaceAfterLogicalNot: false
115+
SpaceAfterTemplateKeyword: true
116+
SpaceBeforeAssignmentOperators: true
117+
SpaceBeforeCpp11BracedList: false
118+
SpaceBeforeCtorInitializerColon: true
119+
SpaceBeforeInheritanceColon: true
120+
SpaceBeforeParens: ControlStatements
121+
SpaceBeforeRangeBasedForLoopColon: true
122+
SpaceInEmptyBlock: false
123+
SpaceInEmptyParentheses: false
124+
SpacesBeforeTrailingComments: 1
125+
SpacesInAngles: false
126+
SpacesInConditionalStatement: false
127+
SpacesInContainerLiterals: true
128+
SpacesInCStyleCastParentheses: false
129+
SpacesInParentheses: false
130+
SpacesInSquareBrackets: false
131+
SpaceBeforeSquareBrackets: false
132+
Standard: Latest
133+
StatementMacros:
134+
- Q_UNUSED
135+
- QT_REQUIRE_VERSION
136+
TabWidth: 8
137+
UseCRLF: false
138+
UseTab: Never
139+
---
140+

.clang-tidy

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
Checks: >
2+
-*,
3+
4+
bugprone-lambda-function-name,
5+
bugprone-macro-parentheses,
6+
bugprone-macro-repeated-side-effects,
7+
bugprone-misplaced-widening-cast,
8+
bugprone-move-forwarding-reference,
9+
bugprone-multiple-statement-macro,
10+
bugprone-parent-virtual-call,
11+
bugprone-sizeof-container,
12+
bugprone-sizeof-expression,
13+
bugprone-string-integer-assignment,
14+
bugprone-string-literal-with-embedded-nul,
15+
bugprone-suspicious-memset-usage,
16+
bugprone-suspicious-missing-comma,
17+
bugprone-suspicious-semicolon,
18+
bugprone-suspicious-string-compare,
19+
bugprone-undelegated-constructor,
20+
bugprone-unused-raii,
21+
bugprone-unused-return-value,
22+
bugprone-assert-side-effect,
23+
bugprone-bool-pointer-implicit-conversion,
24+
bugprone-copy-constructor-init,
25+
bugprone-dangling-handle,
26+
bugprone-fold-init-type,
27+
bugprone-forward-declaration-namespace,
28+
bugprone-forward-reference-overload,
29+
bugprone-inaccurate-erase,
30+
bugprone-incorrect-roundings,
31+
bugprone-integer-division,
32+
bugprone-misplaced-operator-in-strlen-in-alloc,
33+
bugprone-string-constructor,
34+
bugprone-suspicious-enum-usage,
35+
bugprone-swapped-arguments,
36+
bugprone-terminating-continue,
37+
bugprone-throw-keyword-missing,
38+
bugprone-too-small-loop-variable,
39+
bugprone-undefined-memory-manipulation,
40+
bugprone-use-after-move,
41+
bugprone-unhandled-self-assignment,
42+
43+
hicpp-multiway-paths-covered,
44+
45+
clang-analyzer-core.builtin.NoRetmodernize-deprecated-headersurnFunctions,
46+
clang-analyzer-core.CallAndMessage,
47+
clang-analyzer-core.DivideZero,
48+
clang-analyzer-core.DynamicTypePropagation,
49+
clang-analyzer-core.NonnilStringConstants,
50+
clang-analyzer-core.NonNullParamChecker,
51+
clang-analyzer-core.NullDereference,
52+
clang-analyzer-core.StackAddressEscape,
53+
clang-analyzer-core.UndefinedBinaryOperatorResult,
54+
clang-analyzer-core.uninitialized.ArraySubscript,
55+
clang-analyzer-core.uninitializedmodernize-deprecated-headers.Assign,
56+
clang-analyzer-core.uninitialized.Branch,
57+
clang-analyzer-core.uninitialized.CapturedBlockVariable,
58+
clang-analyzer-core.uninitialized.UndefReturn,
59+
clang-analyzer-core.VLASize,
60+
61+
clang-analyzer-cplusplus.NewDelete,
62+
clang-analyzer-cplusplus.NewDeleteLeaks,
63+
clang-analyzer-cplusplus.SelfAssignment,
64+
65+
clang-analyzer-deadcode.DeadStores,
66+
67+
clang-analyzer-optin.cplusplus.VirtualCall,
68+
clang-analyzer-optin.performance.Padding,
69+
70+
clang-analyzer-security.FloatLoopCounter,
71+
clang-analyzer-security.insecureAmodernize-deprecated-headersPI.getpw,
72+
clang-analyzer-security.insecureAPI.gets,
73+
clang-analyzer-security.insecureAPI.mkstemp,
74+
clang-analyzer-security.insecureAPI.mktemp,
75+
clang-analyzer-security.insecureAPI.rand,
76+
clang-analyzer-security.insecureAPI.strcpy,
77+
clang-analyzer-security.insecuremodernize-deprecated-headersAPI.UncheckedReturn,
78+
clang-analyzer-security.insecureAPI.vfork,
79+
80+
clang-analyzer-unix.API,
81+
clang-analyzer-unix.cstring.BadSizeArg,
82+
clang-analyzer-unix.cstring.NullArg,
83+
clang-analyzer-unix.Malloc,
84+
clang-analyzer-unix.MallocSizeof,
85+
clang-analyzer-unix.MismatchedDeallocator,
86+
clang-analyzer-unix.StdCLibraryFunctions,
87+
clang-analyzer-unix.Vfork,
88+
clang-analyzer-valist.CopyToSelf,
89+
clang-analyzer-valist.Uninitialized,
90+
clang-analyzer-valist.Unterminated,
91+
clang-analyzer-nullability.NullablePassedToNonnull,
92+
93+
cert-dcl03-c,
94+
cert-dcl21-cpp,
95+
cert-dcl54-cpp,
96+
cert-dcl58-cpp,
97+
cert-err09-cpp,
98+
cert-err34-c,
99+
cert-err52-cpp,
100+
cert-err58-cpp,
101+
cert-err60-cpp,
102+
cert-fio38-c,
103+
cert-flp30-c,
104+
cert-oop11-cpp,
105+
106+
cppcoreguidelines-c-copy-assignment-signature,
107+
cppcoreguidelines-explicit-virtual-functions,
108+
cppcoreguidelines-interfaces-global-init,
109+
cppcoreguidelines-narrowing-conversions,
110+
cppcoreguidelines-pro-type-const-cast,
111+
cppcoreguidelines-pro-type-cstyle-cast,
112+
cppcoreguidelines-pro-type-member-init,
113+
cppcoreguidelines-pro-type-static-cast-downcast,
114+
cppcoreguidelines-slicing,
115+
cppcoreguidelines-pro-type-vararg,
116+
cppcoreguidelines-special-member-functions,
117+
cppcoreguidelines-avoid-goto,
118+
cppcoreguidelines-pro-type-reinterpret-cast,
119+
120+
google-default-arguments,
121+
google-explicit-constructor,
122+
google-global-names-in-headers,
123+
google-readability-casting,
124+
google-readability-todo,
125+
google-runtime-operator,
126+
google-runtime-int,
127+
128+
hicpp-exception-baseclass,
129+
hicpp-move-const-arg,
130+
hicpp-named-parameter,
131+
hicpp-no-assembler,
132+
hicpp-noexcept-move,
133+
hicpp-signed-bitwise,
134+
hicpp-use-nullptr,
135+
136+
137+
misc-definitions-in-headers,
138+
misc-misplaced-const,
139+
misc-redundant-expression,
140+
misc-unused-alias-decls,
141+
misc-unused-parameters,
142+
misc-unused-using-decls,
143+
misc-unconventional-assign-operator,
144+
145+
146+
readability-delete-null-pointer,
147+
readability-implicit-bool-conversion,
148+
readability-inconsistent-declaration-parameter-name,
149+
readability-redundant-non-const-parameter,
150+
readability-redundant-control-flow,
151+
readability-redundant-declaration,
152+
readability-redundant-function-ptr-dereference,
153+
readability-redundant-member-init,
154+
readability-redundant-smartptr-get,
155+
readability-redundant-string-cstr,
156+
readability-redundant-string-init,
157+
readability-simplify-subscript-expr,
158+
readability-static-accessed-through-instance,
159+
readability-static-definition-in-anonymous-namespace,
160+
readability-string-compare,
161+
readability-uniqueptr-delete-release,
162+
readability-uppercase-literal-suffix,
163+
readability-braces-around-statements,
164+
readability-non-const-parameter,
165+
readability-isolate-declaration,
166+
167+
modernize-loop-convert,
168+
modernize-use-using,
169+
modernize-use-nullptr,
170+
modernize-use-noexcept,
171+
modernize-deprecated-headers,
172+
modernize-avoid-c-arrays,
173+
174+
performance-move-const-arg
175+
176+
WarningsAsErrors: ""
177+
HeaderFilterRegex: ""
178+
AnalyzeTemporaryDtors: false
179+
FormatStyle: none

.eslintrc.cjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,10 @@ module.exports = {
1010
},
1111
],
1212
},
13-
ignorePatterns: ["src/core/instrument.ts", "src/utils/import.js", "src/generator/html-generator/resource/*"],
13+
ignorePatterns: [
14+
"src/core/instrument.ts",
15+
"src/utils/import.js",
16+
"src/generator/html-generator/resource/*",
17+
"third_party/*",
18+
],
1419
};

.github/workflows/ci-test.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,19 @@ on:
66
- "main"
77

88
jobs:
9-
build:
9+
test:
1010
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
node: [16, 18, 20]
1411
steps:
15-
- name: Checkout repository
16-
uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
13+
with:
14+
submodules: true
1715
- uses: actions/setup-node@v3
1816
with:
19-
node-version: ${{ matrix.node }}
17+
node-version: 20
2018

2119
- run: npm ci
22-
23-
- run: npm run build
20+
- run: sudo apt-get install libgtest-dev
2421

2522
- run: npm run lint
26-
23+
- run: npm run build
2724
- run: npm run test

.github/workflows/publish.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ jobs:
99
publish:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
13+
with:
14+
submodules: true
15+
1316
- uses: actions/setup-node@v3
1417
with:
1518
node-version: 20
@@ -18,10 +21,6 @@ jobs:
1821

1922
- run: npm run build
2023

21-
- run: npm run lint
22-
23-
- run: npm run test
24-
2524
- run: npm version $(echo "${GITHUB_REF}" | sed 's/refs\/tags\///') --git-tag-version false
2625
- run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
2726
env:

0 commit comments

Comments
 (0)