@opensip-cli/checks-cpp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +31 -0
- package/dist/__tests__/clang-tidy.test.d.ts +2 -0
- package/dist/__tests__/clang-tidy.test.d.ts.map +1 -0
- package/dist/__tests__/clang-tidy.test.js +91 -0
- package/dist/__tests__/clang-tidy.test.js.map +1 -0
- package/dist/__tests__/fixture-coverage.allowlist.d.ts +22 -0
- package/dist/__tests__/fixture-coverage.allowlist.d.ts.map +1 -0
- package/dist/__tests__/fixture-coverage.allowlist.js +23 -0
- package/dist/__tests__/fixture-coverage.allowlist.js.map +1 -0
- package/dist/__tests__/fixture-coverage.test.d.ts +13 -0
- package/dist/__tests__/fixture-coverage.test.d.ts.map +1 -0
- package/dist/__tests__/fixture-coverage.test.js +57 -0
- package/dist/__tests__/fixture-coverage.test.js.map +1 -0
- package/dist/__tests__/run.test.d.ts +2 -0
- package/dist/__tests__/run.test.d.ts.map +1 -0
- package/dist/__tests__/run.test.js +55 -0
- package/dist/__tests__/run.test.js.map +1 -0
- package/dist/checks/clang-tidy-passthrough.d.ts +12 -0
- package/dist/checks/clang-tidy-passthrough.d.ts.map +1 -0
- package/dist/checks/clang-tidy-passthrough.js +101 -0
- package/dist/checks/clang-tidy-passthrough.js.map +1 -0
- package/dist/display/index.d.ts +9 -0
- package/dist/display/index.d.ts.map +1 -0
- package/dist/display/index.js +4 -0
- package/dist/display/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
OpenSIP CLI
|
|
2
|
+
Copyright 2026 opensip-ai
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
+
this software except in compliance with the License. A copy of the License is
|
|
6
|
+
included in the LICENSE file and is also available at:
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!-- Generated by scripts/build-package-readmes.mjs — do not edit by hand.
|
|
2
|
+
Change the package's "description" (or the generator template) and run
|
|
3
|
+
`pnpm docs:readmes`. CI enforces sync via `pnpm docs:readmes:check`. -->
|
|
4
|
+
|
|
5
|
+
# @opensip-cli/checks-cpp
|
|
6
|
+
|
|
7
|
+
> C/C++ fitness checks (clang-tidy backed)
|
|
8
|
+
|
|
9
|
+
This is a **fitness check pack**. Install it alongside the `opensip-cli` CLI and its checks are discovered automatically.
|
|
10
|
+
|
|
11
|
+
Part of [**opensip-cli**](https://github.com/opensip-ai/opensip-cli) — an open-source codebase-analysis toolkit: fitness checks (`fit`), static call-graph analysis (`graph`), and simulation (`sim`).
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
Most users install the CLI, which bundles the first-party tools:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
curl -fsSL https://opensip.ai/cli/install.sh | bash
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This package is published for the CLI and advanced plugin authors; most users should not install `@opensip-cli/checks-cpp` directly.
|
|
22
|
+
|
|
23
|
+
## Documentation
|
|
24
|
+
|
|
25
|
+
- 📚 Project docs: https://opensip.ai/docs/opensip-cli/
|
|
26
|
+
- 🧠Package catalog (what every package does): https://github.com/opensip-ai/opensip-cli/blob/v0.1.0/docs/public/70-reference/02-package-catalog.md
|
|
27
|
+
- 📦 Source: https://github.com/opensip-ai/opensip-cli/tree/v0.1.0/packages/fitness/checks-cpp
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
Apache-2.0 © opensip-ai
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clang-tidy.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/clang-tidy.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { parseClangTidyOutput } from '../checks/clang-tidy-passthrough.js';
|
|
3
|
+
describe('parseClangTidyOutput', () => {
|
|
4
|
+
it('parses a single warning with a lint name', () => {
|
|
5
|
+
const out = `/abs/path/foo.cpp:42:10: warning: do not use 'goto' [hicpp-avoid-goto]`;
|
|
6
|
+
const violations = parseClangTidyOutput(out, '', 0, ['/abs/path/foo.cpp'], '/abs');
|
|
7
|
+
expect(violations).toHaveLength(1);
|
|
8
|
+
expect(violations[0]?.severity).toBe('warning');
|
|
9
|
+
expect(violations[0]?.line).toBe(42);
|
|
10
|
+
expect(violations[0]?.message).toContain('hicpp-avoid-goto');
|
|
11
|
+
});
|
|
12
|
+
it('captures the file path relative to cwd when the file is inside cwd', () => {
|
|
13
|
+
const out = `/abs/path/foo.cpp:42:10: warning: do not use 'goto' [hicpp-avoid-goto]`;
|
|
14
|
+
const violations = parseClangTidyOutput(out, '', 0, ['/abs/path/foo.cpp'], '/abs');
|
|
15
|
+
expect(violations).toHaveLength(1);
|
|
16
|
+
expect(violations[0]?.filePath).toBe('path/foo.cpp');
|
|
17
|
+
});
|
|
18
|
+
it('captures the file path as absolute when the file is outside cwd', () => {
|
|
19
|
+
// System headers (e.g. /usr/include/...) commonly appear in clang-tidy
|
|
20
|
+
// output and must remain absolute so they aren't ambiguously rooted.
|
|
21
|
+
const out = `/usr/include/stdio.h:10:1: warning: foo [check-x]`;
|
|
22
|
+
const violations = parseClangTidyOutput(out, '', 0, [], '/abs/project');
|
|
23
|
+
expect(violations).toHaveLength(1);
|
|
24
|
+
expect(violations[0]?.filePath).toBe('/usr/include/stdio.h');
|
|
25
|
+
});
|
|
26
|
+
it('captures the column from group 3', () => {
|
|
27
|
+
const out = `/abs/path/foo.cpp:42:17: warning: do not use 'goto' [hicpp-avoid-goto]`;
|
|
28
|
+
const violations = parseClangTidyOutput(out, '', 0, [], '/abs');
|
|
29
|
+
expect(violations).toHaveLength(1);
|
|
30
|
+
expect(violations[0]?.column).toBe(17);
|
|
31
|
+
});
|
|
32
|
+
it('parses errors with severity error', () => {
|
|
33
|
+
const out = `/x/y.cpp:5:1: error: expected ';' [clang-diagnostic-error]`;
|
|
34
|
+
const violations = parseClangTidyOutput(out, '', 1, ['/x/y.cpp'], '/x');
|
|
35
|
+
expect(violations).toHaveLength(1);
|
|
36
|
+
expect(violations[0]?.severity).toBe('error');
|
|
37
|
+
});
|
|
38
|
+
it('skips note: lines (notes are continuations of prior diagnostics)', () => {
|
|
39
|
+
const out = [
|
|
40
|
+
'/x/y.cpp:5:1: warning: prefer enum class [modernize-use-enum-class]',
|
|
41
|
+
'/x/y.cpp:5:1: note: change here',
|
|
42
|
+
].join('\n');
|
|
43
|
+
const violations = parseClangTidyOutput(out, '', 0, [], '/x');
|
|
44
|
+
expect(violations).toHaveLength(1);
|
|
45
|
+
});
|
|
46
|
+
it('handles diagnostics without a lint name', () => {
|
|
47
|
+
const out = `/a/b.cpp:1:1: warning: bare warning`;
|
|
48
|
+
const violations = parseClangTidyOutput(out, '', 0, [], '/a');
|
|
49
|
+
expect(violations).toHaveLength(1);
|
|
50
|
+
expect(violations[0]?.message).toBe('bare warning');
|
|
51
|
+
});
|
|
52
|
+
it('returns empty array on empty stdout', () => {
|
|
53
|
+
expect(parseClangTidyOutput('', '', 0, [], '/x')).toHaveLength(0);
|
|
54
|
+
});
|
|
55
|
+
it('skips lines that do not match the expected diagnostic format', () => {
|
|
56
|
+
const out = 'random output\n2 warnings generated.\n';
|
|
57
|
+
expect(parseClangTidyOutput(out, '', 0, [], '/x')).toEqual([]);
|
|
58
|
+
});
|
|
59
|
+
it('returns multiple violations for multi-line output', () => {
|
|
60
|
+
const out = [
|
|
61
|
+
'/x/y.cpp:1:1: warning: a [check-a]',
|
|
62
|
+
'/x/y.cpp:5:1: warning: b [check-b]',
|
|
63
|
+
'/x/y.cpp:9:1: error: c [check-c]',
|
|
64
|
+
].join('\n');
|
|
65
|
+
const violations = parseClangTidyOutput(out, '', 0, [], '/x');
|
|
66
|
+
expect(violations).toHaveLength(3);
|
|
67
|
+
expect(violations[0]?.line).toBe(1);
|
|
68
|
+
expect(violations[1]?.line).toBe(5);
|
|
69
|
+
expect(violations[2]?.line).toBe(9);
|
|
70
|
+
});
|
|
71
|
+
it('preserves per-file grouping across violations from multiple files', () => {
|
|
72
|
+
// This is the core bug the fix addresses: without filePath capture
|
|
73
|
+
// every violation was bucketed under '' and per-file grouping in the
|
|
74
|
+
// dashboard / SARIF output collapsed unrelated diagnostics together.
|
|
75
|
+
const out = [
|
|
76
|
+
'/proj/src/foo.cpp:1:1: warning: a [check-a]',
|
|
77
|
+
'/proj/src/bar.cpp:5:1: warning: b [check-b]',
|
|
78
|
+
'/proj/src/foo.cpp:9:1: error: c [check-c]',
|
|
79
|
+
].join('\n');
|
|
80
|
+
const violations = parseClangTidyOutput(out, '', 0, [], '/proj');
|
|
81
|
+
expect(violations).toHaveLength(3);
|
|
82
|
+
expect(violations[0]?.filePath).toBe('src/foo.cpp');
|
|
83
|
+
expect(violations[1]?.filePath).toBe('src/bar.cpp');
|
|
84
|
+
expect(violations[2]?.filePath).toBe('src/foo.cpp');
|
|
85
|
+
// Verify that grouping by filePath produces two distinct buckets,
|
|
86
|
+
// not one empty-string bucket as the bug originally produced.
|
|
87
|
+
const filesTouched = new Set(violations.map((v) => v.filePath));
|
|
88
|
+
expect(filesTouched.size).toBe(2);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=clang-tidy.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clang-tidy.test.js","sourceRoot":"","sources":["../../src/__tests__/clang-tidy.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,GAAG,GAAG,wEAAwE,CAAC;QACrF,MAAM,UAAU,GAAG,oBAAoB,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC,CAAC;QACnF,MAAM,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChD,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,MAAM,GAAG,GAAG,wEAAwE,CAAC;QACrF,MAAM,UAAU,GAAG,oBAAoB,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC,CAAC;QACnF,MAAM,CAAC,UAAU,CAAC,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AAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACpD,kEAAkE;QAClE,8DAA8D;QAC9D,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;QAChE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-check fixture-coverage allowlist for checks-cpp (testing gap P0).
|
|
3
|
+
*
|
|
4
|
+
* `ALLOWLIST` is currently empty: there are no shipped, fixture-exercisable
|
|
5
|
+
* checks missing clean+violation fixtures. A future entry would mean a check
|
|
6
|
+
* whose pass/fail fixture coverage is still owed.
|
|
7
|
+
*
|
|
8
|
+
* `COMMAND_EXEMPTIONS` are `analysisMode:'command'` checks that shell out to
|
|
9
|
+
* external tools and cannot be exercised by writing a fixture file; they are
|
|
10
|
+
* covered by the failure-mode / packed-smoke lanes instead (gap register).
|
|
11
|
+
*
|
|
12
|
+
* checks-cpp ships exactly one check today — `cpp-clang-tidy` — and it is a
|
|
13
|
+
* command-mode passthrough to `clang-tidy`. There is therefore no fixture-
|
|
14
|
+
* exercisable check in this pack: ALLOWLIST is already `[]`, and the sole
|
|
15
|
+
* shipped check lives in COMMAND_EXEMPTIONS.
|
|
16
|
+
*/
|
|
17
|
+
import type { CommandExemptions, CoverageAllowlist, FilenameOverrides } from '@opensip-cli/test-support';
|
|
18
|
+
export declare const ALLOWLIST: CoverageAllowlist;
|
|
19
|
+
export declare const COMMAND_EXEMPTIONS: CommandExemptions;
|
|
20
|
+
export declare const FILENAME_OVERRIDES: FilenameOverrides;
|
|
21
|
+
export declare const KNOWN_UNFIXTURABLE: CommandExemptions;
|
|
22
|
+
//# sourceMappingURL=fixture-coverage.allowlist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-coverage.allowlist.d.ts","sourceRoot":"","sources":["../../src/__tests__/fixture-coverage.allowlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,SAAS,EAAE,iBAAsB,CAAC;AAE/C,eAAO,MAAM,kBAAkB,EAAE,iBAGhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,iBAAsB,CAAC;AAExD,eAAO,MAAM,kBAAkB,EAAE,iBAAsB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-check fixture-coverage allowlist for checks-cpp (testing gap P0).
|
|
3
|
+
*
|
|
4
|
+
* `ALLOWLIST` is currently empty: there are no shipped, fixture-exercisable
|
|
5
|
+
* checks missing clean+violation fixtures. A future entry would mean a check
|
|
6
|
+
* whose pass/fail fixture coverage is still owed.
|
|
7
|
+
*
|
|
8
|
+
* `COMMAND_EXEMPTIONS` are `analysisMode:'command'` checks that shell out to
|
|
9
|
+
* external tools and cannot be exercised by writing a fixture file; they are
|
|
10
|
+
* covered by the failure-mode / packed-smoke lanes instead (gap register).
|
|
11
|
+
*
|
|
12
|
+
* checks-cpp ships exactly one check today — `cpp-clang-tidy` — and it is a
|
|
13
|
+
* command-mode passthrough to `clang-tidy`. There is therefore no fixture-
|
|
14
|
+
* exercisable check in this pack: ALLOWLIST is already `[]`, and the sole
|
|
15
|
+
* shipped check lives in COMMAND_EXEMPTIONS.
|
|
16
|
+
*/
|
|
17
|
+
export const ALLOWLIST = [];
|
|
18
|
+
export const COMMAND_EXEMPTIONS = {
|
|
19
|
+
'cpp-clang-tidy': "analysisMode:'command' — shells to clang-tidy; covered by failure-mode + packed-smoke lanes",
|
|
20
|
+
};
|
|
21
|
+
export const FILENAME_OVERRIDES = {};
|
|
22
|
+
export const KNOWN_UNFIXTURABLE = {};
|
|
23
|
+
//# sourceMappingURL=fixture-coverage.allowlist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-coverage.allowlist.js","sourceRoot":"","sources":["../../src/__tests__/fixture-coverage.allowlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,MAAM,CAAC,MAAM,SAAS,GAAsB,EAAE,CAAC;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,gBAAgB,EACd,6FAA6F;CAChG,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAsB,EAAE,CAAC;AAExD,MAAM,CAAC,MAAM,kBAAkB,GAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-check pass/fail fixture coverage for checks-cpp (testing gap P0).
|
|
3
|
+
*
|
|
4
|
+
* Every shipped, non-command, fixture-exercisable check must have a clean
|
|
5
|
+
* fixture (0 findings) and a violation fixture (>=1) under a co-located
|
|
6
|
+
* `__fixtures__/<slug>/` directory next to the check's source. The ALLOWLIST is
|
|
7
|
+
* empty, so the ratchet is live: a new uncovered check fails this test. Command
|
|
8
|
+
* checks live in COMMAND_EXEMPTIONS; structurally un-exercisable checks live in
|
|
9
|
+
* KNOWN_UNFIXTURABLE. The harness runs each check in-process via the engine's
|
|
10
|
+
* internal coverage helpers.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=fixture-coverage.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-coverage.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/fixture-coverage.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-check pass/fail fixture coverage for checks-cpp (testing gap P0).
|
|
3
|
+
*
|
|
4
|
+
* Every shipped, non-command, fixture-exercisable check must have a clean
|
|
5
|
+
* fixture (0 findings) and a violation fixture (>=1) under a co-located
|
|
6
|
+
* `__fixtures__/<slug>/` directory next to the check's source. The ALLOWLIST is
|
|
7
|
+
* empty, so the ratchet is live: a new uncovered check fails this test. Command
|
|
8
|
+
* checks live in COMMAND_EXEMPTIONS; structurally un-exercisable checks live in
|
|
9
|
+
* KNOWN_UNFIXTURABLE. The harness runs each check in-process via the engine's
|
|
10
|
+
* internal coverage helpers.
|
|
11
|
+
*/
|
|
12
|
+
import { dirname, join } from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
import { planCoverageCases, runCheckOnFixture, validateBookkeeping, } from '@opensip-cli/test-support';
|
|
15
|
+
import { describe, expect, it } from 'vitest';
|
|
16
|
+
import { checks } from '../index.js';
|
|
17
|
+
import { ALLOWLIST, COMMAND_EXEMPTIONS, FILENAME_OVERRIDES, KNOWN_UNFIXTURABLE, } from './fixture-coverage.allowlist.js';
|
|
18
|
+
const PACK_SRC = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
19
|
+
const config = {
|
|
20
|
+
packName: 'checks-cpp',
|
|
21
|
+
checks,
|
|
22
|
+
allowlist: ALLOWLIST,
|
|
23
|
+
commandExemptions: COMMAND_EXEMPTIONS,
|
|
24
|
+
knownUnfixturable: KNOWN_UNFIXTURABLE,
|
|
25
|
+
filenameOverrides: FILENAME_OVERRIDES,
|
|
26
|
+
};
|
|
27
|
+
const cases = await planCoverageCases(config, PACK_SRC);
|
|
28
|
+
describe('checks-cpp · fixture-coverage bookkeeping', () => {
|
|
29
|
+
it('config is self-consistent (allowlist empty, exemptions valid)', () => {
|
|
30
|
+
expect(validateBookkeeping(config)).toEqual([]);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
describe('checks-cpp · fixture-coverage', () => {
|
|
34
|
+
if (cases.length === 0) {
|
|
35
|
+
// No fixturable checks (e.g. an all-command pack): assert every shipped
|
|
36
|
+
// check is accounted for by an exemption rather than silently uncovered.
|
|
37
|
+
it('every shipped check is exempted or allowlisted', () => {
|
|
38
|
+
const accounted = ALLOWLIST.length +
|
|
39
|
+
Object.keys(COMMAND_EXEMPTIONS).length +
|
|
40
|
+
Object.keys(KNOWN_UNFIXTURABLE).length;
|
|
41
|
+
expect(accounted).toBeGreaterThan(0);
|
|
42
|
+
});
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
it.each(cases)('$label', async (testCase) => {
|
|
46
|
+
if (!testCase.fixture)
|
|
47
|
+
expect.fail(testCase.missingHint);
|
|
48
|
+
const run = await runCheckOnFixture(testCase.check, testCase.fixture);
|
|
49
|
+
if (testCase.variant === 'clean') {
|
|
50
|
+
expect(run.findings, `clean fixture for '${testCase.slug}' must produce 0 findings`).toHaveLength(0);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
expect(run.findings.length, `violation fixture for '${testCase.slug}' must produce >=1 finding`).toBeGreaterThanOrEqual(1);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=fixture-coverage.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixture-coverage.test.js","sourceRoot":"","sources":["../../src/__tests__/fixture-coverage.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,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KAAK,EAAE,QAAQ,EAAE,EAAE;QAC1C,IAAI,CAAC,QAAQ,CAAC,OAAO;YAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACzD,MAAM,GAAG,GAAG,MAAM,iBAAiB,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,QAAQ,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;YACjC,MAAM,CACJ,GAAG,CAAC,QAAQ,EACZ,sBAAsB,QAAQ,CAAC,IAAI,2BAA2B,CAC/D,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,MAAM,CACJ,GAAG,CAAC,QAAQ,CAAC,MAAM,EACnB,0BAA0B,QAAQ,CAAC,IAAI,4BAA4B,CACpE,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/run.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Execute the check end-to-end so the closures inside the
|
|
3
|
+
* `defineCheck({...})` config (specifically `command.args`) are invoked.
|
|
4
|
+
*
|
|
5
|
+
* The pure parser is exercised by parse.test.ts and clang-tidy.test.ts.
|
|
6
|
+
* This file's purpose is execution coverage for the un-called closures
|
|
7
|
+
* declared inside the check definition.
|
|
8
|
+
*/
|
|
9
|
+
import { describe, expect, it } from 'vitest';
|
|
10
|
+
import { clangTidyPassthrough } from '../checks/clang-tidy-passthrough.js';
|
|
11
|
+
describe('clangTidyPassthrough.run() execution coverage', () => {
|
|
12
|
+
// The clang-tidy bin may be absent (returns ENOENT instantly,
|
|
13
|
+
// common on dev hosts), present and fast (a few seconds), or
|
|
14
|
+
// present and slow (cold-spawn + system-header scans against a
|
|
15
|
+
// missing TU). All three paths satisfy the test's contract: the
|
|
16
|
+
// run does not crash. If the test's 60 s vitest timeout fires
|
|
17
|
+
// during a slow path, the framework throws a clean
|
|
18
|
+
// CheckAbortedError — that's also success because it proves the
|
|
19
|
+
// check responded to the abort signal correctly.
|
|
20
|
+
//
|
|
21
|
+
// The check itself caps at 30 s via
|
|
22
|
+
// `clangTidyPassthrough.config.timeout` so a runaway invocation
|
|
23
|
+
// can't hang indefinitely under any path.
|
|
24
|
+
it('runs end-to-end against a fake target file (clang-tidy not required)', async () => {
|
|
25
|
+
// No fixture content needed — when clang-tidy is missing, the executor
|
|
26
|
+
// returns an error result after invoking config.command.args(files).
|
|
27
|
+
// When clang-tidy is present, it parses output via parseClangTidyOutput.
|
|
28
|
+
// Either path exercises the args() closure.
|
|
29
|
+
try {
|
|
30
|
+
const result = await clangTidyPassthrough.run(process.cwd(), {
|
|
31
|
+
targetFiles: ['/nonexistent/fixture.cpp'],
|
|
32
|
+
});
|
|
33
|
+
expect(result).toBeDefined();
|
|
34
|
+
expect(Array.isArray(result.signals)).toBe(true);
|
|
35
|
+
expect(typeof result.errors).toBe('number');
|
|
36
|
+
expect(typeof result.warnings).toBe('number');
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
const isCleanAbort = error !== null &&
|
|
40
|
+
typeof error === 'object' &&
|
|
41
|
+
'name' in error &&
|
|
42
|
+
error.name === 'CheckAbortedError';
|
|
43
|
+
if (!isCleanAbort)
|
|
44
|
+
throw error;
|
|
45
|
+
expect(isCleanAbort).toBe(true);
|
|
46
|
+
}
|
|
47
|
+
}, 60_000);
|
|
48
|
+
it('exposes a stable check config (id/slug/tags/analysisMode)', () => {
|
|
49
|
+
expect(clangTidyPassthrough.config.slug).toBe('cpp-clang-tidy');
|
|
50
|
+
expect(clangTidyPassthrough.config.analysisMode).toBe('command');
|
|
51
|
+
expect(clangTidyPassthrough.config.tags).toContain('cpp');
|
|
52
|
+
expect(clangTidyPassthrough.config.scansFiles).toBe(false);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=run.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.test.js","sourceRoot":"","sources":["../../src/__tests__/run.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,QAAQ,CAAC,+CAA+C,EAAE,GAAG,EAAE;IAC7D,8DAA8D;IAC9D,6DAA6D;IAC7D,+DAA+D;IAC/D,gEAAgE;IAChE,8DAA8D;IAC9D,mDAAmD;IACnD,gEAAgE;IAChE,iDAAiD;IACjD,EAAE;IACF,oCAAoC;IACpC,gEAAgE;IAChE,0CAA0C;IAC1C,EAAE,CAAC,sEAAsE,EAAE,KAAK,IAAI,EAAE;QACpF,uEAAuE;QACvE,qEAAqE;QACrE,yEAAyE;QACzE,4CAA4C;QAC5C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE;gBAC3D,WAAW,EAAE,CAAC,0BAA0B,CAAC;aAC1C,CAAC,CAAC;YAEH,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;YAC7B,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjD,MAAM,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5C,MAAM,CAAC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,YAAY,GAChB,KAAK,KAAK,IAAI;gBACd,OAAO,KAAK,KAAK,QAAQ;gBACzB,MAAM,IAAI,KAAK;gBACd,KAA4B,CAAC,IAAI,KAAK,mBAAmB,CAAC;YAC7D,IAAI,CAAC,YAAY;gBAAE,MAAM,KAAK,CAAC;YAC/B,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,EAAE,MAAM,CAAC,CAAC;IAEX,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAChE,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjE,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC1D,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CheckViolation } from '@opensip-cli/fitness';
|
|
2
|
+
/**
|
|
3
|
+
* Pure parser for clang-tidy stdout. Accepts the diagnostic format:
|
|
4
|
+
* path/to/file.cpp:LINE:COL: warning: <message> [check-name]
|
|
5
|
+
* Returns one CheckViolation per warning/error line. `note:` lines
|
|
6
|
+
* are dropped today; revisit when adopting `clang-tidy --export-fixes`,
|
|
7
|
+
* where notes are first-class children of diagnostics rather than
|
|
8
|
+
* standalone lines that need re-attachment.
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseClangTidyOutput(stdout: string, _stderr: string, _exitCode: number, _files: readonly string[], cwd: string): CheckViolation[];
|
|
11
|
+
export declare const clangTidyPassthrough: import("@opensip-cli/fitness").Check;
|
|
12
|
+
//# sourceMappingURL=clang-tidy-passthrough.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clang-tidy-passthrough.d.ts","sourceRoot":"","sources":["../../src/checks/clang-tidy-passthrough.ts"],"names":[],"mappings":"AAUA,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA8BxE;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,GAAG,EAAE,MAAM,GACV,cAAc,EAAE,CAgClB;AAED,eAAO,MAAM,oBAAoB,sCAoB/B,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview clang-tidy passthrough check.
|
|
3
|
+
*
|
|
4
|
+
* Runs `clang-tidy` against the matched files and surfaces its
|
|
5
|
+
* diagnostics as opensip-cli violations. The user's `.clang-tidy`
|
|
6
|
+
* config (if present) controls which lints fire — we don't override
|
|
7
|
+
* it. Use `--checks=...` in the args if you want a fixed lint set.
|
|
8
|
+
*/
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
import { defineCheck } from '@opensip-cli/fitness';
|
|
11
|
+
const CLANG_TIDY_LINE =
|
|
12
|
+
// eslint-disable-next-line sonarjs/slow-regex -- input is one bounded line of clang-tidy output; no real ReDoS exposure
|
|
13
|
+
/^(.+?):(\d+):(\d+):\s+(warning|error|note):\s+(.+?)(?:\s+\[([\w\-,.]+)\])?$/;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve a captured clang-tidy file path against `cwd` and convert it
|
|
16
|
+
* to project-relative form when the resolved path falls inside `cwd`.
|
|
17
|
+
* Paths outside `cwd` (e.g. system headers under `/usr/include`) are
|
|
18
|
+
* left absolute so they remain unambiguous.
|
|
19
|
+
*
|
|
20
|
+
* Note on empty `cwd`: when called with `cwd === ''`, `path.resolve`
|
|
21
|
+
* falls back to `process.cwd()`. The production `command`-mode caller
|
|
22
|
+
* (`executeCommandMode` in `@opensip-cli/fitness`) always passes a
|
|
23
|
+
* non-empty cwd, so the production contract is well-defined; the
|
|
24
|
+
* pass-through is tolerated only as a convenience for tests and is
|
|
25
|
+
* not part of the public surface.
|
|
26
|
+
*/
|
|
27
|
+
function resolveFilePath(capturedPath, cwd) {
|
|
28
|
+
const absolute = path.resolve(cwd, capturedPath);
|
|
29
|
+
const relative = path.relative(cwd, absolute);
|
|
30
|
+
// `path.relative` returns a `..`-prefixed path (or absolute on Windows
|
|
31
|
+
// when drives differ) when the resolved path is outside `cwd`.
|
|
32
|
+
if (relative === '' || relative.startsWith('..') || path.isAbsolute(relative)) {
|
|
33
|
+
return absolute;
|
|
34
|
+
}
|
|
35
|
+
return relative;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Pure parser for clang-tidy stdout. Accepts the diagnostic format:
|
|
39
|
+
* path/to/file.cpp:LINE:COL: warning: <message> [check-name]
|
|
40
|
+
* Returns one CheckViolation per warning/error line. `note:` lines
|
|
41
|
+
* are dropped today; revisit when adopting `clang-tidy --export-fixes`,
|
|
42
|
+
* where notes are first-class children of diagnostics rather than
|
|
43
|
+
* standalone lines that need re-attachment.
|
|
44
|
+
*/
|
|
45
|
+
export function parseClangTidyOutput(stdout, _stderr, _exitCode, _files, cwd) {
|
|
46
|
+
const violations = [];
|
|
47
|
+
const lines = stdout.split('\n');
|
|
48
|
+
for (const line of lines) {
|
|
49
|
+
const match = CLANG_TIDY_LINE.exec(line);
|
|
50
|
+
if (!match)
|
|
51
|
+
continue;
|
|
52
|
+
const filePath = match[1];
|
|
53
|
+
const lineStr = match[2];
|
|
54
|
+
const colStr = match[3];
|
|
55
|
+
const severity = match[4];
|
|
56
|
+
const message = match[5];
|
|
57
|
+
const lintName = match[6];
|
|
58
|
+
if (severity === 'note')
|
|
59
|
+
continue;
|
|
60
|
+
// The regex guarantees groups 1 (filePath), 2 (lineStr), 3 (colStr), 4
|
|
61
|
+
// (severity) and 5 (message) are non-empty captures when it matches; the
|
|
62
|
+
// `?` / `??` fallbacks below exist for type-narrowing of `match[n]` (which
|
|
63
|
+
// is typed `string | undefined`) and are not reachable at runtime. Only
|
|
64
|
+
// group 6 (lintName) is optional in the pattern and is exercised by tests.
|
|
65
|
+
violations.push({
|
|
66
|
+
/* v8 ignore next */
|
|
67
|
+
message: lintName ? `[${lintName}] ${message}` : (message ?? 'clang-tidy diagnostic'),
|
|
68
|
+
severity: severity === 'error' ? 'error' : 'warning',
|
|
69
|
+
/* v8 ignore next */
|
|
70
|
+
line: lineStr ? Number.parseInt(lineStr, 10) : 1,
|
|
71
|
+
/* v8 ignore next */
|
|
72
|
+
column: colStr ? Number.parseInt(colStr, 10) : undefined,
|
|
73
|
+
/* v8 ignore next */
|
|
74
|
+
filePath: filePath ? resolveFilePath(filePath, cwd) : undefined,
|
|
75
|
+
suggestion: 'See clang-tidy docs for the named lint',
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return violations;
|
|
79
|
+
}
|
|
80
|
+
export const clangTidyPassthrough = defineCheck({
|
|
81
|
+
id: 'e9769a00-b576-44a6-b73a-b340c597bc86',
|
|
82
|
+
slug: 'cpp-clang-tidy',
|
|
83
|
+
description: 'Run clang-tidy and surface its diagnostics as opensip-cli violations',
|
|
84
|
+
scope: { languages: ['cpp'], concerns: [] },
|
|
85
|
+
tags: ['quality', 'cpp'],
|
|
86
|
+
// Cap the per-invocation runtime so a slow clang-tidy (or one hung
|
|
87
|
+
// on an unusual TU) can't block the run indefinitely. Most healthy
|
|
88
|
+
// clang-tidy invocations finish within a few seconds; anything
|
|
89
|
+
// taking longer is more useful aborted than awaited.
|
|
90
|
+
timeout: 30_000,
|
|
91
|
+
command: {
|
|
92
|
+
bin: 'clang-tidy',
|
|
93
|
+
args: (files) => [...files, '--quiet'],
|
|
94
|
+
parseOutput: parseClangTidyOutput,
|
|
95
|
+
// clang-tidy returns 1 when warnings are emitted with -warnings-as-errors,
|
|
96
|
+
// but with --quiet and default config, exit 0 means clean run.
|
|
97
|
+
// Diagnostics are present on stdout regardless.
|
|
98
|
+
expectedExitCodes: [0, 1],
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=clang-tidy-passthrough.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clang-tidy-passthrough.js","sourceRoot":"","sources":["../../src/checks/clang-tidy-passthrough.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,WAAW,EAAuB,MAAM,sBAAsB,CAAC;AAExE,MAAM,eAAe;AACnB,wHAAwH;AACxH,6EAA6E,CAAC;AAEhF;;;;;;;;;;;;GAYG;AACH,SAAS,eAAe,CAAC,YAAoB,EAAE,GAAW;IACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC9C,uEAAuE;IACvE,+DAA+D;IAC/D,IAAI,QAAQ,KAAK,EAAE,IAAI,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9E,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAc,EACd,OAAe,EACf,SAAiB,EACjB,MAAyB,EACzB,GAAW;IAEX,MAAM,UAAU,GAAqB,EAAE,CAAC;IACxC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjC,KAAK,MAA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,EAAE,wCAAwC;SACrD,CAAC,CAAC;IACL,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;IAC9C,EAAE,EAAE,sCAAsC;IAC1C,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,sEAAsE;IACnF,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3C,IAAI,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC;IACxB,mEAAmE;IACnE,mEAAmE;IACnE,+DAA+D;IAC/D,qDAAqD;IACrD,OAAO,EAAE,MAAM;IACf,OAAO,EAAE;QACP,GAAG,EAAE,YAAY;QACjB,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,EAAE,SAAS,CAAC;QACtC,WAAW,EAAE,oBAAoB;QACjC,2EAA2E;QAC3E,+DAA+D;QAC/D,gDAAgD;QAChD,iBAAiB,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;KAC1B;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Display metadata for C/C++ fitness checks.
|
|
3
|
+
*
|
|
4
|
+
* Maps each check slug to its [icon, displayName] tuple for CLI/report
|
|
5
|
+
* rendering. Keys must match the `slug` of the corresponding check.
|
|
6
|
+
*/
|
|
7
|
+
import type { CheckDisplayEntry } from '@opensip-cli/fitness';
|
|
8
|
+
export declare const checkDisplay: Readonly<Record<string, CheckDisplayEntry>>;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAEpE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/display/index.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,YAAY,GAAgD;IACvE,wBAAwB,EAAE,CAAC,IAAI,EAAE,wBAAwB,CAAC;CAC3D,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM,wCAA0D,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { applyCheckDisplay } from '@opensip-cli/fitness';
|
|
2
|
+
import { clangTidyPassthrough } from './checks/clang-tidy-passthrough.js';
|
|
3
|
+
import { checkDisplay } from './display/index.js';
|
|
4
|
+
// Display (icon + name) is folded ONTO each check from this pack's `checkDisplay`
|
|
5
|
+
// authoring map (§5.3) — display travels on `check.config`, no separate export.
|
|
6
|
+
export const checks = applyCheckDisplay([clangTidyPassthrough], checkDisplay);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,kFAAkF;AAClF,gFAAgF;AAChF,MAAM,CAAC,MAAM,MAAM,GAAG,iBAAiB,CAAC,CAAC,oBAAoB,CAAC,EAAE,YAAY,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opensip-cli/checks-cpp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"description": "C/C++ fitness checks (clang-tidy backed)",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"opensip-cli",
|
|
8
|
+
"static-analysis",
|
|
9
|
+
"code-quality",
|
|
10
|
+
"fitness-checks",
|
|
11
|
+
"linting",
|
|
12
|
+
"cpp",
|
|
13
|
+
"c++"
|
|
14
|
+
],
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/opensip-ai/opensip-cli.git",
|
|
18
|
+
"directory": "packages/fitness/checks-cpp"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/opensip-ai/opensip-cli",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/opensip-ai/opensip-cli/issues"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"opensipTools": {
|
|
26
|
+
"kind": "fit-pack"
|
|
27
|
+
},
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"LICENSE",
|
|
36
|
+
"NOTICE"
|
|
37
|
+
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@opensip-cli/core": "0.1.0",
|
|
40
|
+
"@opensip-cli/fitness": "0.1.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^24.13.2",
|
|
44
|
+
"vitest": "^4.1.8",
|
|
45
|
+
"@opensip-cli/test-support": "0.1.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc",
|
|
49
|
+
"test": "vitest run --passWithNoTests",
|
|
50
|
+
"typecheck": "tsc --noEmit",
|
|
51
|
+
"clean": "rm -rf dist"
|
|
52
|
+
}
|
|
53
|
+
}
|