@vyuhlabs/dxkit 2.4.1 → 2.4.3
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/CHANGELOG.md +265 -0
- package/README.md +9 -1
- package/dist/analyzers/tools/coverage.d.ts +4 -15
- package/dist/analyzers/tools/coverage.d.ts.map +1 -1
- package/dist/analyzers/tools/coverage.js +9 -201
- package/dist/analyzers/tools/coverage.js.map +1 -1
- package/dist/analyzers/tools/generic.d.ts.map +1 -1
- package/dist/analyzers/tools/generic.js +21 -4
- package/dist/analyzers/tools/generic.js.map +1 -1
- package/dist/analyzers/tools/graphify.js +2 -2
- package/dist/analyzers/tools/grep-secrets.d.ts.map +1 -1
- package/dist/analyzers/tools/grep-secrets.js +10 -1
- package/dist/analyzers/tools/grep-secrets.js.map +1 -1
- package/dist/analyzers/tools/tool-registry.d.ts.map +1 -1
- package/dist/analyzers/tools/tool-registry.js +6 -20
- package/dist/analyzers/tools/tool-registry.js.map +1 -1
- package/dist/constants.d.ts +3 -3
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +41 -17
- package/dist/constants.js.map +1 -1
- package/dist/detect.d.ts.map +1 -1
- package/dist/detect.js +15 -16
- package/dist/detect.js.map +1 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +10 -16
- package/dist/doctor.js.map +1 -1
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +41 -75
- package/dist/generator.js.map +1 -1
- package/dist/languages/csharp.d.ts.map +1 -1
- package/dist/languages/csharp.js +27 -1
- package/dist/languages/csharp.js.map +1 -1
- package/dist/languages/go.d.ts +10 -0
- package/dist/languages/go.d.ts.map +1 -1
- package/dist/languages/go.js +89 -1
- package/dist/languages/go.js.map +1 -1
- package/dist/languages/index.d.ts +42 -1
- package/dist/languages/index.d.ts.map +1 -1
- package/dist/languages/index.js +55 -0
- package/dist/languages/index.js.map +1 -1
- package/dist/languages/python.d.ts +3 -0
- package/dist/languages/python.d.ts.map +1 -1
- package/dist/languages/python.js +55 -1
- package/dist/languages/python.js.map +1 -1
- package/dist/languages/rust.d.ts.map +1 -1
- package/dist/languages/rust.js +8 -0
- package/dist/languages/rust.js.map +1 -1
- package/dist/languages/types.d.ts +69 -1
- package/dist/languages/types.d.ts.map +1 -1
- package/dist/languages/typescript.d.ts +5 -0
- package/dist/languages/typescript.d.ts.map +1 -1
- package/dist/languages/typescript.js +72 -2
- package/dist/languages/typescript.js.map +1 -1
- package/dist/project-yaml.d.ts.map +1 -1
- package/dist/project-yaml.js +19 -15
- package/dist/project-yaml.js.map +1 -1
- package/dist/types.d.ts +33 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,271 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.4.3] - 2026-04-26
|
|
11
|
+
|
|
12
|
+
Phase 10i.0-LP — language-pack architectural refactor. Two user-visible
|
|
13
|
+
fixes (graphify + dotnet auto-discovery), one developer-experience win
|
|
14
|
+
(test suite from 30 min flaky to 2 min deterministic), and an
|
|
15
|
+
architectural cleanup that makes adding a new language pack a one-command
|
|
16
|
+
scaffold (`npm run new-lang <id> "<displayName>"`) instead of a
|
|
17
|
+
13-file scavenger hunt. Closes audit items #1–#7 and #9–#14 (12 items)
|
|
18
|
+
plus **D009** and a doctor-check gap that had no D-id.
|
|
19
|
+
|
|
20
|
+
No breaking changes for end users. Internal architecture only — every
|
|
21
|
+
analyzer command (`health`, `vulnerabilities`, `bom`, etc.) produces
|
|
22
|
+
identical output before and after.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- **`graphify` "failed to run" in `health` and `quality` reports.** The
|
|
27
|
+
graphifyy@0.5.0 release renamed the result-dict key of `god_nodes()`
|
|
28
|
+
from `"edges"` to `"degree"` (same NetworkX node-degree semantic). The
|
|
29
|
+
Python script in `buildGraphifyScript` raised `KeyError: 'edges'`,
|
|
30
|
+
suppressed by the runner's `2>/dev/null`, surfacing only as
|
|
31
|
+
`Unavailable: graphify (failed to run)` in every health/quality
|
|
32
|
+
report — degrading complexity/cohesion/maintainability scoring
|
|
33
|
+
silently. One-line key rename. (`src/analyzers/tools/graphify.ts`)
|
|
34
|
+
|
|
35
|
+
- **`~/.dotnet` missing from `getSystemPaths()` auto-discovery.**
|
|
36
|
+
Microsoft's recommended non-sudo path is
|
|
37
|
+
`dotnet-install.sh --install-dir $HOME/.dotnet`. Without this entry
|
|
38
|
+
in the system-paths probe list, contributors and customers had to
|
|
39
|
+
manually export `PATH=$HOME/.dotnet:$PATH` before dxkit detected
|
|
40
|
+
dotnet. Added alongside the existing `~/.cargo/bin`, `~/go/bin`
|
|
41
|
+
entries. (`src/analyzers/tools/tool-registry.ts`)
|
|
42
|
+
|
|
43
|
+
- **`vyuh-dxkit doctor` was silently skipping all C# toolchain checks.**
|
|
44
|
+
The pre-LP toolchain-check section in `doctor.ts` had explicit
|
|
45
|
+
branches for python/go/node/rust but **no `if (manifest.config.languages.csharp)` clause** — so .NET
|
|
46
|
+
projects ran `doctor` and saw a clean bill of health regardless of
|
|
47
|
+
whether dotnet was installed. Pack-driven iteration (LP.1) auto-fixes
|
|
48
|
+
this: csharp pack now declares `cliBinaries: ['dotnet']` and doctor
|
|
49
|
+
surfaces missing dotnet on .NET projects. No D-id (discovered + fixed
|
|
50
|
+
in the same commit). (`src/doctor.ts`)
|
|
51
|
+
|
|
52
|
+
- **`cross-ecosystem.test.ts` was unusable on resource-constrained
|
|
53
|
+
developer machines** — 30 min wall-clock with 15 spurious failures
|
|
54
|
+
per run, blocking the progressive-regression workflow. Three root
|
|
55
|
+
causes:
|
|
56
|
+
|
|
57
|
+
1. Vitest 3.x's `pool: 'threads'` birpc channel between worker and
|
|
58
|
+
main starves under heavy concurrent subprocess fan-out (this suite
|
|
59
|
+
spawns ~22 network-bound child processes); workers can't ack
|
|
60
|
+
`onTaskUpdate` within 60s and vitest emits `Timeout calling
|
|
61
|
+
onTaskUpdate`, **failing completed-and-passing tests as a side
|
|
62
|
+
effect** (vitest #8164). 13 of the 15 prior "failures" were this
|
|
63
|
+
spurious RPC bug, not real assertion failures. Switched to
|
|
64
|
+
`pool: 'forks'` — each test file in its own child Node process,
|
|
65
|
+
no shared birpc channel.
|
|
66
|
+
2. `testTimeout: 60000` was tight on cold-cache machines; both real
|
|
67
|
+
non-spurious failures were `pip-audit` and `cargo-audit`
|
|
68
|
+
exceeding 60s on first run. Bumped to 180s.
|
|
69
|
+
3. The 22 subprocess invocations were redundant — multiple `it()`
|
|
70
|
+
blocks across the file invoked the same `node dxkit <report>
|
|
71
|
+
<fixture>` command. Added a per-(command, fixture) Promise-cache
|
|
72
|
+
so each fixture's vulnerability/quality/test-gaps report runs
|
|
73
|
+
once and is shared by all assertions; concurrent racing tests
|
|
74
|
+
receive the same in-flight promise. Cuts subprocess count ~50%.
|
|
75
|
+
|
|
76
|
+
Combined effect: full suite runs from **30 min with 15 spurious
|
|
77
|
+
failures** to **2:30 with zero**. (`vitest.config.ts`,
|
|
78
|
+
`test/integration/cross-ecosystem.test.ts`)
|
|
79
|
+
|
|
80
|
+
### Added
|
|
81
|
+
|
|
82
|
+
- **`npm run new-lang <id> "<displayName>"`** — language-pack
|
|
83
|
+
scaffolder. Generates the 7 recipe files (pack stub, test stub,
|
|
84
|
+
fixture skeleton, Claude rule file, template-config dir) and
|
|
85
|
+
updates `src/types.ts` (extends `LanguageId` union) plus
|
|
86
|
+
`src/languages/index.ts` (registers in `LANGUAGES`). Generated code
|
|
87
|
+
is type-safe by construction — no casts. Prints a next-steps
|
|
88
|
+
checklist for the work scaffolding can't automate (detect logic,
|
|
89
|
+
capability providers, fixture content, CI toolchain install,
|
|
90
|
+
CONTRIBUTING.md row). (`scripts/scaffold-language.js`,
|
|
91
|
+
`package.json`)
|
|
92
|
+
|
|
93
|
+
- **`scripts/check-architecture.sh`** — three new pre-commit + CI
|
|
94
|
+
rules enforcing pack-coupling discipline:
|
|
95
|
+
- LP-A1: no hardcoded `IF_<LANG>` references outside the
|
|
96
|
+
constants→generator pipeline
|
|
97
|
+
- LP-A2: no direct `config.languages.<id>` lookups outside the
|
|
98
|
+
registry-bridge files
|
|
99
|
+
- LP-A3: no hardcoded `<lang>.md` rule-file strings outside packs
|
|
100
|
+
- **`test/languages-contract.test.ts`** — five new per-pack tests:
|
|
101
|
+
metadata completeness (`permissions`, `cliBinaries`,
|
|
102
|
+
`defaultVersion`, `projectYamlBlock`) plus the **D009 reverse-direction
|
|
103
|
+
contract test** (every declared tool either invoked via TOOL_DEFS, by
|
|
104
|
+
shell-command literal, by `node_modules/.bin/<binary>` path, or on
|
|
105
|
+
the artifact-generating allowlist).
|
|
106
|
+
- **`test/recipe-playbook.test.ts`** — synthetic 6th-pack injection
|
|
107
|
+
test. Defines a mock `kotlin` pack, mutates the `LANGUAGES` registry
|
|
108
|
+
to include it, and asserts every pack-iterating consumer
|
|
109
|
+
(generator, doctor, detect, project-yaml, constants, coverage,
|
|
110
|
+
generic, grep-secrets, tool-registry) picks up its contributions.
|
|
111
|
+
Empirical guarantee that the architecture is pack-driven.
|
|
112
|
+
|
|
113
|
+
- **5 new `LanguageSupport` capabilities** for pack metadata that
|
|
114
|
+
consumers iterate (no per-language if-chains):
|
|
115
|
+
`permissions: string[]`, `ruleFile?: string`,
|
|
116
|
+
`templateFiles?: { template; output }[]`, `cliBinaries: string[]`,
|
|
117
|
+
`defaultVersion: string`, `versionKey?: keyof DetectedStack['versions']`,
|
|
118
|
+
`projectYamlBlock?: (ctx) => string`. Plus a coverage-parser capability
|
|
119
|
+
via direct ownership: per-language parsers (Istanbul, coverage.py,
|
|
120
|
+
Go cover-profile) moved out of `src/analyzers/tools/coverage.ts`
|
|
121
|
+
into their respective pack modules.
|
|
122
|
+
|
|
123
|
+
### Changed
|
|
124
|
+
|
|
125
|
+
- **`DetectedStack.languages`** — refactored from a fixed-shape
|
|
126
|
+
interface (`{ python, go, node, nextjs, rust, csharp }`) to
|
|
127
|
+
`Record<LanguageId, boolean>`. The `nextjs` flag moves out of
|
|
128
|
+
`languages` and is now exclusively the framework signal under the
|
|
129
|
+
top-level `framework: 'nextjs'` field — preserved in the legacy
|
|
130
|
+
`IF_NEXTJS` template variable for backwards compatibility.
|
|
131
|
+
|
|
132
|
+
Adding a 6th language pack now extends the `LanguageId` union once
|
|
133
|
+
and registers in `LANGUAGES`; **no fixed-shape interface to edit**.
|
|
134
|
+
This is the missing piece that makes the LP "7-file recipe" actually
|
|
135
|
+
7 files.
|
|
136
|
+
|
|
137
|
+
Programmatic consumers of the `detect()` function should note that
|
|
138
|
+
`stack.languages.node` and `stack.languages.nextjs` no longer exist;
|
|
139
|
+
instead, `stack.languages.typescript` is `true` for both Node and
|
|
140
|
+
Next.js projects (typescript pack matches any `package.json`), and
|
|
141
|
+
`stack.framework === 'nextjs'` distinguishes Next.js. The published
|
|
142
|
+
template variables `IF_NODE`, `IF_NEXTJS`, `NODE_VERSION` are
|
|
143
|
+
unchanged.
|
|
144
|
+
|
|
145
|
+
- **`generator.ts`, `doctor.ts`, `detect.ts`, `coverage.ts`,
|
|
146
|
+
`generic.ts`, `grep-secrets.ts`, `project-yaml.ts`, `constants.ts`,
|
|
147
|
+
`tool-registry.ts`** — all per-language if-chains replaced with
|
|
148
|
+
iteration over the `LANGUAGES` registry. 12 of the 14 LP-audit
|
|
149
|
+
items closed across these files (the audit doc lives in `tmp/` if
|
|
150
|
+
curious).
|
|
151
|
+
|
|
152
|
+
### Internal
|
|
153
|
+
|
|
154
|
+
- Phase 10i.0-LP closed audit items #1–#7, #9–#13 (the per-pack
|
|
155
|
+
if-chain cluster + the medium-structural cluster).
|
|
156
|
+
- Phase 10f.4 closed audit item #14 (`DetectedStack.languages`
|
|
157
|
+
interface refactor — the type-system surgery).
|
|
158
|
+
- D009 (declared-vs-used tool drift contract test) closed via the
|
|
159
|
+
reverse-direction test in `languages-contract.test.ts`.
|
|
160
|
+
|
|
161
|
+
## [2.4.2] - 2026-04-25
|
|
162
|
+
|
|
163
|
+
Phase 10i.0 — cross-ecosystem matrix completion. Establishes the
|
|
164
|
+
"matrix layer" of `test/integration/cross-ecosystem.test.ts` — a
|
|
165
|
+
data-driven `BENCHMARK_LANGUAGES` table that drives uniform
|
|
166
|
+
per-language assertions for **every** report dimension. The 2.4.1
|
|
167
|
+
fixtures only validated `dxkit vulnerabilities`; this release adds
|
|
168
|
+
matrix coverage for **secrets, lint, duplications, and test-gaps**
|
|
169
|
+
across all 5 benchmark languages, plus a CI-enforced parity gate so
|
|
170
|
+
new feature dimensions can't ship without per-language coverage.
|
|
171
|
+
|
|
172
|
+
Closes **D016** — surfaced and fixed during 10i.0.2.
|
|
173
|
+
|
|
174
|
+
### Fixed
|
|
175
|
+
|
|
176
|
+
- **C# `dotnet-format` parser returned zero violations on every real
|
|
177
|
+
.NET project** since the C# pack landed. The lint provider counted
|
|
178
|
+
lines containing the substring `'Formatted'` to derive violation
|
|
179
|
+
count; real `dotnet format --verify-no-changes` output uses
|
|
180
|
+
`path/to/File.cs(line,col): error CODE: message [project]` — the
|
|
181
|
+
string `'Formatted'` never appears. Same drift shape as 2.4.1's
|
|
182
|
+
D005 C# vulnerabilities defect: parser written against synthetic
|
|
183
|
+
output, never validated against real tool output. Fixed by
|
|
184
|
+
matching the canonical `\): error \w+:` regex. Caught by adding
|
|
185
|
+
the C# row to the new lint matrix; the row failed because the
|
|
186
|
+
parser returned 0 despite exit code != 0 and visible violations
|
|
187
|
+
in the output. (`src/languages/csharp.ts`, **D016**)
|
|
188
|
+
|
|
189
|
+
### Added
|
|
190
|
+
|
|
191
|
+
- **Cross-ecosystem matrix layer** (`test/integration/cross-ecosystem.test.ts`).
|
|
192
|
+
New `BENCHMARK_LANGUAGES` table at the top of the file is the
|
|
193
|
+
single source of truth for which languages participate and where
|
|
194
|
+
each fixture's deliberate findings live. Each `describe('matrix —
|
|
195
|
+
<report>')` block iterates the table to produce one uniform
|
|
196
|
+
assertion per language — adding a new feature is one new
|
|
197
|
+
optional field per row + one new `matrix —` describe; adding a
|
|
198
|
+
6th language is one row append + one fixture dir + one CI install.
|
|
199
|
+
No search-and-replace across describe blocks.
|
|
200
|
+
|
|
201
|
+
- **`matrix — secrets` (Phase 10i.0.1)** — 5 hardcoded fake AWS
|
|
202
|
+
access keys (`AKIA1234567890ABCDEF` — patterned digits/letters
|
|
203
|
+
that pass gitleaks' `aws-access-token` regex but fail real AWS
|
|
204
|
+
validation and GitHub push protection). One per benchmark
|
|
205
|
+
ecosystem. Asserts `dxkit vulnerabilities` surfaces a
|
|
206
|
+
`SecretFinding` (category=secret, tool=gitleaks,
|
|
207
|
+
rule=aws-access-token) for each.
|
|
208
|
+
|
|
209
|
+
- **`matrix — lint` (Phase 10i.0.2)** — 5 deliberate idiomatic
|
|
210
|
+
linter violations (Python ruff F401 unused-import, Go gosimple
|
|
211
|
+
S1002 bool-comparison, Rust clippy unused_variables, C#
|
|
212
|
+
dotnet-format whitespace × 2). Asserts `dxkit quality` reports
|
|
213
|
+
the expected linter and ≥1 lint finding. CI workflow now
|
|
214
|
+
installs `ruff` (pipx), `golangci-lint` (curl install script),
|
|
215
|
+
and `clippy` (rustup component) alongside the existing depVulns
|
|
216
|
+
toolchains; `dotnet format` ships in the .NET 8 SDK.
|
|
217
|
+
|
|
218
|
+
- **`matrix — duplications` (Phase 10i.0.3)** — two near-identical
|
|
219
|
+
helpers per fixture, sized comfortably above jscpd's
|
|
220
|
+
`--min-lines 5 --min-tokens 50` defaults (initial pass had
|
|
221
|
+
~30-token bodies that fell below the threshold; widened on the
|
|
222
|
+
way in). Asserts `metrics.duplication.cloneCount > 0`.
|
|
223
|
+
|
|
224
|
+
- **`matrix — test-gaps` (Phase 10i.0.4)** — one untested source
|
|
225
|
+
module per fixture with no matching test file. Asserts
|
|
226
|
+
`dxkit test-gaps` returns the file in `gaps[]` with
|
|
227
|
+
`hasMatchingTest: false`. No coverage artifact committed —
|
|
228
|
+
filename-match coverage source is the matrix's canonical
|
|
229
|
+
fallback.
|
|
230
|
+
|
|
231
|
+
- **`scripts/check-cross-ecosystem-coverage.sh` parity gate**
|
|
232
|
+
(Phase 10i.0.5) — parses the test file and verifies every
|
|
233
|
+
(report × language) cell has BOTH metadata in
|
|
234
|
+
`BENCHMARK_LANGUAGES` and a matching `matrix — <report>`
|
|
235
|
+
describe. Exits non-zero with a specific cell-pointer error
|
|
236
|
+
message if any are missing. Wired into both `.github/workflows/ci.yml`
|
|
237
|
+
and `.husky/pre-commit` so contributors catch parity gaps locally
|
|
238
|
+
before push. Documented as a 4-step recipe in the script header
|
|
239
|
+
for adding a new matrix dimension.
|
|
240
|
+
|
|
241
|
+
- **`.dxkit-ignore`** at repo root excludes `test/fixtures/benchmarks/`
|
|
242
|
+
from dxkit's own self-scan (`vyuh-dxkit vulnerabilities .` from
|
|
243
|
+
this repo) so the deliberate fixture findings don't false-positive
|
|
244
|
+
in dxkit's own report. Cross-ecosystem.test.ts is unaffected — it
|
|
245
|
+
scans fixture dirs as cwd, where the repo-root `.dxkit-ignore`
|
|
246
|
+
doesn't apply.
|
|
247
|
+
|
|
248
|
+
### Changed
|
|
249
|
+
|
|
250
|
+
- **Bumped `vitest` 2.1.4 → 3.2.4 and `@vitest/coverage-v8` 2.1.9 →
|
|
251
|
+
3.2.4 together** (matched 3.2.4 pair, peer-deps clean). vitest 3
|
|
252
|
+
introduces a hardcoded 60s `onTaskUpdate` ack timeout on the
|
|
253
|
+
worker→main birpc channel (vitest-dev/vitest #8164) — a sync-
|
|
254
|
+
blocked test thread (`execSync` shelling out for >60s) starves the
|
|
255
|
+
channel and vitest exits non-zero with an unhandled error even when
|
|
256
|
+
every test passes. Refactored `cross-ecosystem.test.ts` to use
|
|
257
|
+
`util.promisify(exec)` for all shell-outs (pip-audit, govulncheck,
|
|
258
|
+
dotnet restore, cargo-audit) so the runner stays responsive.
|
|
259
|
+
|
|
260
|
+
- **Default `vitest.config.ts` `testTimeout` 30s → 60s.** The
|
|
261
|
+
cross-ecosystem suite shells out to network-dependent registries
|
|
262
|
+
(npm/pypi/crates.io/nuget); 30s was tight enough to flake on
|
|
263
|
+
slow-network days (pip-audit observed at 27-34s on the
|
|
264
|
+
`requests@2.20.0` fixture). Unit tests are unaffected — they fail
|
|
265
|
+
fast on assertion errors; only hangs care about the timeout.
|
|
266
|
+
|
|
267
|
+
- **`.gitignore`** adds `test/fixtures/benchmarks/**/target/` so
|
|
268
|
+
cargo's build dir doesn't get committed when contributors run the
|
|
269
|
+
Rust matrix locally.
|
|
270
|
+
|
|
271
|
+
- **CONTRIBUTING.md toolchain table** grows a "Matrix rows" column
|
|
272
|
+
and `ruff` / `golangci-lint` / `gitleaks` rows, since each is now
|
|
273
|
+
a matrix-dimension toolchain (not just a depVulns one).
|
|
274
|
+
|
|
10
275
|
## [2.4.1] - 2026-04-25
|
|
11
276
|
|
|
12
277
|
Phase 10h.6.8 — cross-ecosystem benchmark validation. Builds five
|
package/README.md
CHANGED
|
@@ -157,7 +157,15 @@ When present (typically written by `@vyuhlabs/create-devstack`), `dxkit init` re
|
|
|
157
157
|
|
|
158
158
|
## Language Support
|
|
159
159
|
|
|
160
|
-
Each language is a single `LanguageSupport` implementation in `src/languages/`.
|
|
160
|
+
Each language is a single `LanguageSupport` implementation in `src/languages/`. Detection, tools, coverage parsing, import extraction, and lint severity mapping live in one place per language.
|
|
161
|
+
|
|
162
|
+
Adding a new language is a single command followed by filling in TODO markers:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npm run new-lang kotlin "Kotlin (Android)"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
This scaffolds the 7 recipe files (pack module, test stub, fixture skeleton, Claude rule file, template-config dir, plus `LanguageId` union extension and `LANGUAGES` registration). See [CONTRIBUTING.md](./CONTRIBUTING.md) for the full walkthrough. Recipe enforcement (architecture greps + contract tests + synthetic 6th-pack playbook) runs in pre-commit so packs that miss required metadata fail CI.
|
|
161
169
|
|
|
162
170
|
| Language | Detection | Coverage import | Import-graph | Native tools | Lint severity tiers | Vuln severity tiers |
|
|
163
171
|
| -------- | ------------------------------------ | ------------------- | -------------------------------------- | ----------------------------------- | ---------------------- | ----------------------------------- |
|
|
@@ -51,19 +51,8 @@ export interface Coverage {
|
|
|
51
51
|
* now (would need per-language file weighting).
|
|
52
52
|
*/
|
|
53
53
|
export declare function loadCoverage(cwd: string): Promise<Coverage | null>;
|
|
54
|
-
/**
|
|
55
|
-
export declare function
|
|
56
|
-
/**
|
|
57
|
-
export declare function
|
|
58
|
-
/** coverage.py JSON: `{ "totals": {...}, "files": { "path": { summary: {...} } } }`. */
|
|
59
|
-
export declare function parseCoveragePy(raw: string, sourceFile: string, cwd: string): Coverage;
|
|
60
|
-
/**
|
|
61
|
-
* Go coverprofile:
|
|
62
|
-
* mode: set
|
|
63
|
-
* pkg/path/file.go:5.2,10.1 3 1
|
|
64
|
-
*
|
|
65
|
-
* Each line: file:startLine.col,endLine.col numStatements count.
|
|
66
|
-
* A block is covered iff count > 0.
|
|
67
|
-
*/
|
|
68
|
-
export declare function parseGoCoverProfile(raw: string, sourceFile: string, cwd: string): Coverage;
|
|
54
|
+
/** Round to one decimal place. Used by every coverage parser for the linePercent contract. */
|
|
55
|
+
export declare function round1(n: number): number;
|
|
56
|
+
/** Turn an absolute or prefixed coverage path into a project-relative path. */
|
|
57
|
+
export declare function toRelative(p: string, cwd: string): string;
|
|
69
58
|
//# sourceMappingURL=coverage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH,MAAM,MAAM,cAAc,GACtB,kBAAkB,GAClB,gBAAgB,GAChB,aAAa,GACb,IAAI,GACJ,WAAW,GACX,MAAM,CAAC;AAEX,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,QAAQ;IACvB,8BAA8B;IAC9B,MAAM,EAAE,cAAc,CAAC;IACvB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAClC;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAQxE;AAUD,8FAA8F;AAC9F,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAExC;AAED,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAUzD"}
|
|
@@ -20,47 +20,10 @@
|
|
|
20
20
|
* artifact exists or parsing fails; callers (tests analyzer) should
|
|
21
21
|
* treat a null return as "fall back to filename matching."
|
|
22
22
|
*/
|
|
23
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
-
}
|
|
29
|
-
Object.defineProperty(o, k2, desc);
|
|
30
|
-
}) : (function(o, m, k, k2) {
|
|
31
|
-
if (k2 === undefined) k2 = k;
|
|
32
|
-
o[k2] = m[k];
|
|
33
|
-
}));
|
|
34
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
-
}) : function(o, v) {
|
|
37
|
-
o["default"] = v;
|
|
38
|
-
});
|
|
39
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
40
|
-
var ownKeys = function(o) {
|
|
41
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
42
|
-
var ar = [];
|
|
43
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
44
|
-
return ar;
|
|
45
|
-
};
|
|
46
|
-
return ownKeys(o);
|
|
47
|
-
};
|
|
48
|
-
return function (mod) {
|
|
49
|
-
if (mod && mod.__esModule) return mod;
|
|
50
|
-
var result = {};
|
|
51
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
52
|
-
__setModuleDefault(result, mod);
|
|
53
|
-
return result;
|
|
54
|
-
};
|
|
55
|
-
})();
|
|
56
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
24
|
exports.loadCoverage = loadCoverage;
|
|
58
|
-
exports.
|
|
59
|
-
exports.
|
|
60
|
-
exports.parseCoveragePy = parseCoveragePy;
|
|
61
|
-
exports.parseGoCoverProfile = parseGoCoverProfile;
|
|
62
|
-
const fs = __importStar(require("fs"));
|
|
63
|
-
const path = __importStar(require("path"));
|
|
25
|
+
exports.round1 = round1;
|
|
26
|
+
exports.toRelative = toRelative;
|
|
64
27
|
const languages_1 = require("../../languages");
|
|
65
28
|
const descriptors_1 = require("../../languages/capabilities/descriptors");
|
|
66
29
|
const dispatcher_1 = require("../dispatcher");
|
|
@@ -85,151 +48,14 @@ async function loadCoverage(cwd) {
|
|
|
85
48
|
const envelope = await dispatcher_1.defaultDispatcher.gather(cwd, descriptors_1.COVERAGE, providers);
|
|
86
49
|
return envelope?.coverage ?? null;
|
|
87
50
|
}
|
|
88
|
-
// ─── Parsers ────────────────────────────────────────────────────────────────
|
|
89
|
-
/** Istanbul coverage-summary.json: `{ "total": {...}, "/abs/path": {...} }`. */
|
|
90
|
-
function parseIstanbulSummary(raw, sourceFile, cwd) {
|
|
91
|
-
const data = JSON.parse(raw);
|
|
92
|
-
const files = new Map();
|
|
93
|
-
let totalCovered = 0;
|
|
94
|
-
let totalLines = 0;
|
|
95
|
-
for (const [key, entry] of Object.entries(data)) {
|
|
96
|
-
if (key === 'total')
|
|
97
|
-
continue;
|
|
98
|
-
const lines = entry?.lines;
|
|
99
|
-
if (!lines || typeof lines.covered !== 'number' || typeof lines.total !== 'number')
|
|
100
|
-
continue;
|
|
101
|
-
const rel = toRelative(key, cwd);
|
|
102
|
-
const fc = {
|
|
103
|
-
path: rel,
|
|
104
|
-
covered: lines.covered,
|
|
105
|
-
total: lines.total,
|
|
106
|
-
pct: round1(lines.total > 0 ? (lines.covered / lines.total) * 100 : 0),
|
|
107
|
-
};
|
|
108
|
-
files.set(rel, fc);
|
|
109
|
-
totalCovered += lines.covered;
|
|
110
|
-
totalLines += lines.total;
|
|
111
|
-
}
|
|
112
|
-
const total = data.total?.lines;
|
|
113
|
-
const linePercent = total && typeof total.pct === 'number'
|
|
114
|
-
? round1(total.pct)
|
|
115
|
-
: round1(totalLines > 0 ? (totalCovered / totalLines) * 100 : 0);
|
|
116
|
-
return { source: 'istanbul-summary', sourceFile, linePercent, files };
|
|
117
|
-
}
|
|
118
|
-
/** Istanbul coverage-final.json: `{ "/abs/path": { s: { "0": 1, "1": 0, ... }, statementMap: {...} } }`. */
|
|
119
|
-
function parseIstanbulFinal(raw, sourceFile, cwd) {
|
|
120
|
-
const data = JSON.parse(raw);
|
|
121
|
-
const files = new Map();
|
|
122
|
-
let totalCovered = 0;
|
|
123
|
-
let totalStatements = 0;
|
|
124
|
-
for (const [key, entry] of Object.entries(data)) {
|
|
125
|
-
const s = entry?.s;
|
|
126
|
-
if (!s || typeof s !== 'object')
|
|
127
|
-
continue;
|
|
128
|
-
const counts = Object.values(s);
|
|
129
|
-
const total = counts.length;
|
|
130
|
-
const covered = counts.filter((n) => typeof n === 'number' && n > 0).length;
|
|
131
|
-
const rel = toRelative(entry.path || key, cwd);
|
|
132
|
-
files.set(rel, {
|
|
133
|
-
path: rel,
|
|
134
|
-
covered,
|
|
135
|
-
total,
|
|
136
|
-
pct: round1(total > 0 ? (covered / total) * 100 : 0),
|
|
137
|
-
});
|
|
138
|
-
totalCovered += covered;
|
|
139
|
-
totalStatements += total;
|
|
140
|
-
}
|
|
141
|
-
return {
|
|
142
|
-
source: 'istanbul-final',
|
|
143
|
-
sourceFile,
|
|
144
|
-
linePercent: round1(totalStatements > 0 ? (totalCovered / totalStatements) * 100 : 0),
|
|
145
|
-
files,
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
/** coverage.py JSON: `{ "totals": {...}, "files": { "path": { summary: {...} } } }`. */
|
|
149
|
-
function parseCoveragePy(raw, sourceFile, cwd) {
|
|
150
|
-
const data = JSON.parse(raw);
|
|
151
|
-
const files = new Map();
|
|
152
|
-
let totalCovered = 0;
|
|
153
|
-
let totalStatements = 0;
|
|
154
|
-
for (const [key, entry] of Object.entries(data.files ?? {})) {
|
|
155
|
-
const summary = entry?.summary;
|
|
156
|
-
if (!summary)
|
|
157
|
-
continue;
|
|
158
|
-
const total = typeof summary.num_statements === 'number' ? summary.num_statements : 0;
|
|
159
|
-
const missing = typeof summary.missing_lines === 'number' ? summary.missing_lines : 0;
|
|
160
|
-
const covered = typeof summary.covered_lines === 'number'
|
|
161
|
-
? summary.covered_lines
|
|
162
|
-
: Math.max(0, total - missing);
|
|
163
|
-
const rel = toRelative(key, cwd);
|
|
164
|
-
files.set(rel, {
|
|
165
|
-
path: rel,
|
|
166
|
-
covered,
|
|
167
|
-
total,
|
|
168
|
-
pct: round1(typeof summary.percent_covered === 'number'
|
|
169
|
-
? summary.percent_covered
|
|
170
|
-
: total > 0
|
|
171
|
-
? (covered / total) * 100
|
|
172
|
-
: 0),
|
|
173
|
-
});
|
|
174
|
-
totalCovered += covered;
|
|
175
|
-
totalStatements += total;
|
|
176
|
-
}
|
|
177
|
-
const linePercent = typeof data.totals?.percent_covered === 'number'
|
|
178
|
-
? round1(data.totals.percent_covered)
|
|
179
|
-
: round1(totalStatements > 0 ? (totalCovered / totalStatements) * 100 : 0);
|
|
180
|
-
return { source: 'coverage-py', sourceFile, linePercent, files };
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Go coverprofile:
|
|
184
|
-
* mode: set
|
|
185
|
-
* pkg/path/file.go:5.2,10.1 3 1
|
|
186
|
-
*
|
|
187
|
-
* Each line: file:startLine.col,endLine.col numStatements count.
|
|
188
|
-
* A block is covered iff count > 0.
|
|
189
|
-
*/
|
|
190
|
-
function parseGoCoverProfile(raw, sourceFile, cwd) {
|
|
191
|
-
const perFile = new Map();
|
|
192
|
-
let totalCovered = 0;
|
|
193
|
-
let totalStatements = 0;
|
|
194
|
-
for (const line of raw.split('\n')) {
|
|
195
|
-
if (!line || line.startsWith('mode:'))
|
|
196
|
-
continue;
|
|
197
|
-
// file:startLine.col,endLine.col numStatements count
|
|
198
|
-
const m = line.match(/^(.+):\d+\.\d+,\d+\.\d+\s+(\d+)\s+(\d+)$/);
|
|
199
|
-
if (!m)
|
|
200
|
-
continue;
|
|
201
|
-
const file = m[1];
|
|
202
|
-
const stmts = parseInt(m[2], 10);
|
|
203
|
-
const count = parseInt(m[3], 10);
|
|
204
|
-
const bucket = perFile.get(file) ?? { covered: 0, total: 0 };
|
|
205
|
-
bucket.total += stmts;
|
|
206
|
-
if (count > 0)
|
|
207
|
-
bucket.covered += stmts;
|
|
208
|
-
perFile.set(file, bucket);
|
|
209
|
-
totalStatements += stmts;
|
|
210
|
-
if (count > 0)
|
|
211
|
-
totalCovered += stmts;
|
|
212
|
-
}
|
|
213
|
-
const files = new Map();
|
|
214
|
-
for (const [key, { covered, total }] of perFile) {
|
|
215
|
-
// Go coverprofile uses module-relative paths (e.g. github.com/user/repo/pkg/foo.go).
|
|
216
|
-
// Strip the module prefix if it resolves to a real file in cwd.
|
|
217
|
-
const rel = resolveGoPath(key, cwd);
|
|
218
|
-
files.set(rel, {
|
|
219
|
-
path: rel,
|
|
220
|
-
covered,
|
|
221
|
-
total,
|
|
222
|
-
pct: round1(total > 0 ? (covered / total) * 100 : 0),
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
return {
|
|
226
|
-
source: 'go',
|
|
227
|
-
sourceFile,
|
|
228
|
-
linePercent: round1(totalStatements > 0 ? (totalCovered / totalStatements) * 100 : 0),
|
|
229
|
-
files,
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
51
|
// ─── Helpers ────────────────────────────────────────────────────────────────
|
|
52
|
+
//
|
|
53
|
+
// Per-language parsers (Istanbul/coverage.py/Go cover-profile/lcov/cobertura)
|
|
54
|
+
// moved into their respective `src/languages/<id>.ts` packs in Phase
|
|
55
|
+
// 10i.0-LP.4. coverage.ts now hosts only the shared types + small
|
|
56
|
+
// utilities the parsers depend on. Adding a 6th language's coverage
|
|
57
|
+
// format is a pack-local change — no edits to this file required.
|
|
58
|
+
/** Round to one decimal place. Used by every coverage parser for the linePercent contract. */
|
|
233
59
|
function round1(n) {
|
|
234
60
|
return Math.round(n * 10) / 10;
|
|
235
61
|
}
|
|
@@ -247,22 +73,4 @@ function toRelative(p, cwd) {
|
|
|
247
73
|
out = out.slice(2);
|
|
248
74
|
return out;
|
|
249
75
|
}
|
|
250
|
-
/**
|
|
251
|
-
* Go coverprofile paths look like `github.com/user/repo/pkg/foo.go`. If that
|
|
252
|
-
* file doesn't exist at cwd, try stripping leading segments until we find one
|
|
253
|
-
* that does. Fall back to the original string if nothing resolves.
|
|
254
|
-
*/
|
|
255
|
-
function resolveGoPath(p, cwd) {
|
|
256
|
-
const norm = p.replace(/\\/g, '/');
|
|
257
|
-
// Already relative and exists?
|
|
258
|
-
if (fs.existsSync(path.join(cwd, norm)))
|
|
259
|
-
return norm;
|
|
260
|
-
const parts = norm.split('/');
|
|
261
|
-
for (let i = 1; i < parts.length; i++) {
|
|
262
|
-
const candidate = parts.slice(i).join('/');
|
|
263
|
-
if (fs.existsSync(path.join(cwd, candidate)))
|
|
264
|
-
return candidate;
|
|
265
|
-
}
|
|
266
|
-
return norm;
|
|
267
|
-
}
|
|
268
76
|
//# sourceMappingURL=coverage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../../src/analyzers/tools/coverage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG
|
|
1
|
+
{"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../../src/analyzers/tools/coverage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAgDH,oCAQC;AAWD,wBAEC;AAGD,gCAUC;AAhFD,+CAAwD;AACxD,0EAAoE;AAGpE,8CAAkD;AAgClD;;;;;;;;;GASG;AACI,KAAK,UAAU,YAAY,CAAC,GAAW;IAC5C,MAAM,SAAS,GAAyC,EAAE,CAAC;IAC3D,KAAK,MAAM,IAAI,IAAI,IAAA,iCAAqB,EAAC,GAAG,CAAC,EAAE,CAAC;QAC9C,IAAI,IAAI,CAAC,YAAY,EAAE,QAAQ;YAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9E,CAAC;IACD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,MAAM,QAAQ,GAAG,MAAM,8BAAiB,CAAC,MAAM,CAAC,GAAG,EAAE,sBAAQ,EAAE,SAAS,CAAC,CAAC;IAC1E,OAAO,QAAQ,EAAE,QAAQ,IAAI,IAAI,CAAC;AACpC,CAAC;AAED,+EAA+E;AAC/E,EAAE;AACF,8EAA8E;AAC9E,qEAAqE;AACrE,kEAAkE;AAClE,oEAAoE;AACpE,kEAAkE;AAElE,8FAA8F;AAC9F,SAAgB,MAAM,CAAC,CAAS;IAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;AACjC,CAAC;AAED,+EAA+E;AAC/E,SAAgB,UAAU,CAAC,CAAS,EAAE,GAAW;IAC/C,IAAI,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACxC,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC,EAAE,CAAC;QAClC,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACtC,CAAC;SAAM,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;QAC3B,GAAG,GAAG,EAAE,CAAC;IACX,CAAC;IACD,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7C,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/generic.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../src/analyzers/tools/generic.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAqDzC,qDAAqD;AACrD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA4KxE"}
|
|
@@ -42,6 +42,7 @@ exports.gatherGenericMetrics = gatherGenericMetrics;
|
|
|
42
42
|
const fs = __importStar(require("fs"));
|
|
43
43
|
const runner_1 = require("./runner");
|
|
44
44
|
const exclusions_1 = require("./exclusions");
|
|
45
|
+
const languages_1 = require("../../languages");
|
|
45
46
|
// grepCount uses a narrow filter (node_modules, dist, __pycache__, .d.ts) to
|
|
46
47
|
// preserve pre-refactor byte-equality. The broader EXCLUDED_DIRS list from
|
|
47
48
|
// exclusions.ts is used for find-based counts. Widening this filter would
|
|
@@ -63,10 +64,26 @@ function grepCount(cwd, pattern, includes) {
|
|
|
63
64
|
}
|
|
64
65
|
// EXCLUDE moved inside gatherGenericMetrics() — must be computed per-cwd now
|
|
65
66
|
// so it picks up project-specific .gitignore / .dxkit-ignore entries.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
// Pack-driven find expressions (Phase 10i.0-LP.3). Replaces the
|
|
68
|
+
// pre-LP hardcoded extension/pattern lists with iteration over the
|
|
69
|
+
// language registry. Adding a 6th pack auto-extends both expressions.
|
|
70
|
+
//
|
|
71
|
+
// Behavior expansions vs pre-LP.3 (both more correct than before):
|
|
72
|
+
// - `.mjs`/`.cjs` now counted as source files (TypeScript pack
|
|
73
|
+
// declared them in `sourceExtensions`; the legacy hardcoded list
|
|
74
|
+
// missed them).
|
|
75
|
+
// - Rust integration tests under `tests/*.rs` now counted as test
|
|
76
|
+
// files (Rust pack declared `tests/*.rs` as a path-anchored
|
|
77
|
+
// pattern; the legacy used only `-name` and skipped path patterns).
|
|
78
|
+
const SOURCE_EXTS = `\\( ${(0, languages_1.allSourceExtensions)()
|
|
79
|
+
.map((e) => `-name "*${e}"`)
|
|
80
|
+
.join(' -o ')} \\)`;
|
|
81
|
+
const TEST_PATTERNS = (() => {
|
|
82
|
+
const { nameOnly, pathAnchored } = (0, languages_1.splitTestFilePatterns)();
|
|
83
|
+
const nameClauses = nameOnly.map((p) => `-name "${p}"`);
|
|
84
|
+
const pathClauses = pathAnchored.map((p) => `-path "*/${p}"`);
|
|
85
|
+
return `\\( ${[...nameClauses, ...pathClauses].join(' -o ')} \\)`;
|
|
86
|
+
})();
|
|
70
87
|
/** Gather metrics using only built-in Unix tools. */
|
|
71
88
|
function gatherGenericMetrics(cwd) {
|
|
72
89
|
const EXCLUDE = (0, exclusions_1.getFindExcludeFlags)(cwd);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../../../src/analyzers/tools/generic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../../../src/analyzers/tools/generic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,oDA4KC;AAxOD;;;;GAIG;AACH,uCAAyB;AAEzB,qCAAuD;AACvD,6CAAmD;AACnD,+CAA6E;AAE7E,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,gFAAgF;AAChF,MAAM,oBAAoB,GAAG,2DAA2D,CAAC;AAEzF,+FAA+F;AAC/F,SAAS,SAAS,CAAC,GAAW,EAAE,OAAe,EAAE,QAAkB;IACjE,MAAM,WAAW,GAAG,mBAAmB,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IAC/F,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACvC,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvE,MAAM,MAAM,GAAG,IAAA,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