@ploaness/cli 1.1.0 → 1.3.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/dist/checks/assets.d.ts +12 -0
- package/dist/checks/assets.d.ts.map +1 -1
- package/dist/checks/assets.js +27 -4
- package/dist/checks/assets.js.map +1 -1
- package/dist/checks/blocklist.d.ts +8 -0
- package/dist/checks/blocklist.d.ts.map +1 -0
- package/dist/checks/blocklist.js +106 -0
- package/dist/checks/blocklist.js.map +1 -0
- package/dist/checks/container-run.d.ts +23 -0
- package/dist/checks/container-run.d.ts.map +1 -0
- package/dist/checks/container-run.js +55 -0
- package/dist/checks/container-run.js.map +1 -0
- package/dist/checks/containers.d.ts.map +1 -1
- package/dist/checks/containers.js +2 -32
- package/dist/checks/containers.js.map +1 -1
- package/dist/checks/dependencies.d.ts.map +1 -1
- package/dist/checks/dependencies.js +75 -52
- package/dist/checks/dependencies.js.map +1 -1
- package/dist/checks/editorconfig.js +6 -5
- package/dist/checks/editorconfig.js.map +1 -1
- package/dist/checks/environment.d.ts +3 -3
- package/dist/checks/environment.d.ts.map +1 -1
- package/dist/checks/environment.js +29 -14
- package/dist/checks/environment.js.map +1 -1
- package/dist/checks/infra.d.ts +5 -0
- package/dist/checks/infra.d.ts.map +1 -0
- package/dist/checks/infra.js +185 -0
- package/dist/checks/infra.js.map +1 -0
- package/dist/checks/install.d.ts +2 -0
- package/dist/checks/install.d.ts.map +1 -1
- package/dist/checks/install.js +10 -1
- package/dist/checks/install.js.map +1 -1
- package/dist/checks/oxlint.d.ts +5 -0
- package/dist/checks/oxlint.d.ts.map +1 -0
- package/dist/checks/oxlint.js +85 -0
- package/dist/checks/oxlint.js.map +1 -0
- package/dist/checks/payload.d.ts +11 -0
- package/dist/checks/payload.d.ts.map +1 -1
- package/dist/checks/payload.js +130 -9
- package/dist/checks/payload.js.map +1 -1
- package/dist/checks/shell.d.ts +5 -0
- package/dist/checks/shell.d.ts.map +1 -0
- package/dist/checks/shell.js +78 -0
- package/dist/checks/shell.js.map +1 -0
- package/dist/checks/suppressions.d.ts +2 -2
- package/dist/checks/suppressions.d.ts.map +1 -1
- package/dist/checks/suppressions.js +31 -11
- package/dist/checks/suppressions.js.map +1 -1
- package/dist/checks/tree.d.ts +1 -1
- package/dist/checks/tree.d.ts.map +1 -1
- package/dist/checks/tree.js +6 -26
- package/dist/checks/tree.js.map +1 -1
- package/dist/checks/wiring.d.ts +10 -0
- package/dist/checks/wiring.d.ts.map +1 -1
- package/dist/checks/wiring.js +16 -4
- package/dist/checks/wiring.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/context.d.ts +1 -23
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +16 -33
- package/dist/context.js.map +1 -1
- package/dist/gates.d.ts.map +1 -1
- package/dist/gates.js +54 -13
- package/dist/gates.js.map +1 -1
- package/dist/probes/payload-defaults.probe.d.ts +2 -0
- package/dist/probes/payload-defaults.probe.d.ts.map +1 -0
- package/dist/probes/payload-defaults.probe.js +116 -0
- package/dist/probes/payload-defaults.probe.js.map +1 -0
- package/dist/source-comments.d.ts +9 -0
- package/dist/source-comments.d.ts.map +1 -0
- package/dist/source-comments.js +54 -0
- package/dist/source-comments.js.map +1 -0
- package/dist/working-tree.d.ts +5 -0
- package/dist/working-tree.d.ts.map +1 -0
- package/dist/working-tree.js +36 -0
- package/dist/working-tree.js.map +1 -0
- package/package.json +6 -5
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
// behind" is, and that is a real liability.
|
|
5
5
|
import { realpathSync } from 'node:fs';
|
|
6
6
|
import path from 'node:path';
|
|
7
|
-
import { asRecord, asText, collectCoordinates, findFreshnessViolations, findLicenseViolations, HARNESS_EXCEPTIONS, HARNESS_PACKAGE, hoursPublished, inheritedManifestPaths, isArray, isHeldByReleaseAge, isRecord, judgeVulnerabilities, mapWithConcurrency, NETWORKED_TOOL_TIMEOUT_MS, REGISTRY_CONCURRENCY, RELEASE_AGE_FLOOR_HOURS, REQUEST_TIMEOUT_MS, } from '@ploaness/governance';
|
|
7
|
+
import { asRecord, asText, collectCoordinates, findFreshnessViolations, findLicenseViolations, HARNESS_EXCEPTIONS, HARNESS_PACKAGE, hoursPublished, inheritedManifestPaths, isArray, isHarnessRelease, isHarnessRepository, isHeldByReleaseAge, isRecord, judgeVulnerabilities, mapWithConcurrency, NETWORKED_TOOL_TIMEOUT_MS, REGISTRY_CONCURRENCY, RELEASE_AGE_FLOOR_HOURS, REQUEST_TIMEOUT_MS, scopeFreshness, sectionFreshnessReport, } from '@ploaness/governance';
|
|
8
8
|
import { manifestPathFrom, readJson, workingTreeFiles } from '../context.js';
|
|
9
9
|
import { failed, passed, run, TIMED_OUT_CODE, withOutput, } from '../exec.js';
|
|
10
10
|
import { imageFreshness } from './images.js';
|
|
11
|
+
import { harnessDecidedVersions } from './wiring.js';
|
|
11
12
|
/** Every dependency license must sit inside the allowlist. */
|
|
12
13
|
// Report enough of a tool's raw output to diagnose it, without pasting a whole log into a finding.
|
|
13
14
|
const MAX_REPORTED_CHARS = 2000;
|
|
@@ -133,7 +134,13 @@ const attemptLookup = async (name) => {
|
|
|
133
134
|
if (response.ok) {
|
|
134
135
|
const body = await response.json();
|
|
135
136
|
const version = asRecord(body)['version'];
|
|
136
|
-
|
|
137
|
+
// The licence rides along so the blocklist can stop the bound short of a release the licence gate
|
|
138
|
+
// would refuse. Read only as a string: an old package records it as an object, which says nothing
|
|
139
|
+
// this rule can judge.
|
|
140
|
+
const license = asRecord(body)['license'];
|
|
141
|
+
return typeof version === 'string'
|
|
142
|
+
? { kind: 'version', version, license: typeof license === 'string' ? license : undefined }
|
|
143
|
+
: { kind: 'absent' };
|
|
137
144
|
}
|
|
138
145
|
// A 404 is a real answer, and retrying cannot change it.
|
|
139
146
|
return response.status === NOT_FOUND ? { kind: 'absent' } : undefined;
|
|
@@ -154,7 +161,13 @@ const sortLookups = (coordinates, lookups) => {
|
|
|
154
161
|
if (lookup?.kind !== 'version') {
|
|
155
162
|
return [];
|
|
156
163
|
}
|
|
157
|
-
return [
|
|
164
|
+
return [
|
|
165
|
+
{
|
|
166
|
+
...coordinate,
|
|
167
|
+
latest: lookup.version,
|
|
168
|
+
...(lookup.license !== undefined && { latestLicense: lookup.license }),
|
|
169
|
+
},
|
|
170
|
+
];
|
|
158
171
|
});
|
|
159
172
|
return {
|
|
160
173
|
statuses,
|
|
@@ -196,30 +209,17 @@ const publishedAt = async (name, version) => {
|
|
|
196
209
|
// report to name it for every coordinate, and a workspace pinning one analyzer in two places is exactly
|
|
197
210
|
// the case where the bare package name says nothing about where to make the change.
|
|
198
211
|
const describeFinding = (finding) => `${finding.owner} ${finding.name}: declared ${finding.current}, latest ${finding.latest}`;
|
|
199
|
-
//
|
|
200
|
-
//
|
|
201
|
-
|
|
202
|
-
// no release carries the newer pin yet. The same answer `HARNESS_EXCEPTIONS` gives for an advisory
|
|
203
|
-
// carried by ploaness's own chain.
|
|
204
|
-
const HARNESS_REPAIR = ' - declared by ploaness rather than by the project, so upgrade ploaness, or report it if no ' +
|
|
205
|
-
'release carries the newer pin';
|
|
206
|
-
// A shorter marker than HARNESS_REPAIR, because it appears on every inherited update rather than on
|
|
207
|
-
// the rare overdue one, and it answers a different question: `stale` has to say what to DO, while an
|
|
208
|
-
// ordinary update only has to say whose declaration it is. A consuming project reported these rows as
|
|
209
|
-
// noise, and it was reading correctly - they named a manifest under `@ploaness/` and nothing said that
|
|
210
|
-
// naming meant "not yours to change".
|
|
211
|
-
const HARNESS_OWNED = ' - ploaness declares this, not the project';
|
|
212
|
-
// Read from `isInherited` rather than from the verdict. Only an inherited coordinate can reach these
|
|
213
|
-
// lines with a `fail`, because a project's own failure stops the build instead - so the two were
|
|
214
|
-
// equivalent, and stating the one that is actually meant is what keeps them equivalent.
|
|
215
|
-
const ownerNote = (finding, note) => finding.isInherited ? note : '';
|
|
212
|
+
// Said on the harness release's own line, because it is the one update in the project's group whose
|
|
213
|
+
// repair is also the repair of every line in the two groups beneath it.
|
|
214
|
+
const HARNESS_RELEASE_NOTE = ' - upgrading it is what moves every version ploaness decides';
|
|
216
215
|
// `stale`, not `update`, for a coordinate past the bound that does not stop this build. Printed as an
|
|
217
216
|
// ordinary update it would bury the one line saying the harness itself is overdue among a dozen saying
|
|
218
|
-
// a patch release exists.
|
|
217
|
+
// a patch release exists. What to DO about either is the heading's job, so neither line repeats it: a
|
|
218
|
+
// note on every inherited row was what a consuming project reported as noise.
|
|
219
|
+
const harnessNote = (finding) => isHarnessRelease(finding) ? HARNESS_RELEASE_NOTE : '';
|
|
219
220
|
const describeReported = (finding) => finding.verdict === 'fail'
|
|
220
|
-
? `stale ${describeFinding(finding)}; past the freshness bound`
|
|
221
|
-
|
|
222
|
-
: `update ${describeFinding(finding)}${ownerNote(finding, HARNESS_OWNED)}`;
|
|
221
|
+
? `stale ${describeFinding(finding)}; past the freshness bound`
|
|
222
|
+
: `update ${describeFinding(finding)}${harnessNote(finding)}`;
|
|
223
223
|
// `held`, not `update`, for a release pnpm will refuse for being too young. Naming it as an ordinary
|
|
224
224
|
// update sends the reader to an install that fails, and the way past that failure is an exclusion from
|
|
225
225
|
// the very guard the wait exists to keep. It says the age so the reader can see how short the wait is.
|
|
@@ -229,26 +229,46 @@ const describeHeld = (finding, hours) => {
|
|
|
229
229
|
`${String(RELEASE_AGE_FLOOR_HOURS)}h release-age floor pnpm enforces, so it installs once it ages`);
|
|
230
230
|
};
|
|
231
231
|
// A date is asked for only where it can change the line: a coordinate already past the bound is stale
|
|
232
|
-
// whatever its age, and one
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
const projectRowsFirst = (reported) => [
|
|
238
|
-
...reported.filter((finding) => !finding.isInherited),
|
|
239
|
-
...reported.filter((finding) => finding.isInherited),
|
|
240
|
-
];
|
|
241
|
-
const describeUpdates = async (reported, now) => await mapWithConcurrency(projectRowsFirst(reported), REGISTRY_CONCURRENCY, async (finding) => {
|
|
242
|
-
if (!isHeldCandidate(finding)) {
|
|
232
|
+
// whatever its age, and one the project cannot install on its own - a pin, or a line in an inherited
|
|
233
|
+
// manifest - is not waiting on the registry at all.
|
|
234
|
+
const isHeldCandidate = (finding, repair) => finding.verdict === 'update' && repair === 'project';
|
|
235
|
+
const describeLine = async (finding, repair, now) => {
|
|
236
|
+
if (!isHeldCandidate(finding, repair)) {
|
|
243
237
|
return describeReported(finding);
|
|
244
238
|
}
|
|
245
|
-
const age = {
|
|
246
|
-
publishedAt: await publishedAt(finding.name, finding.latest),
|
|
247
|
-
now,
|
|
248
|
-
};
|
|
239
|
+
const age = { publishedAt: await publishedAt(finding.name, finding.latest), now };
|
|
249
240
|
return isHeldByReleaseAge(age)
|
|
250
241
|
? describeHeld(finding, hoursPublished(age))
|
|
251
242
|
: describeReported(finding);
|
|
243
|
+
};
|
|
244
|
+
// The images ploaness pins are declared in the harness, so in a consumer they sit with the manifests
|
|
245
|
+
// it inherits; in ploaness's own repository they are its own to change like everything else there.
|
|
246
|
+
const imageRepair = (ownership) => ownership.isHarnessItself ? 'project' : 'inherited';
|
|
247
|
+
const INDENT = ' ';
|
|
248
|
+
// A group prints only when it has a line to put under its heading, because a heading over nothing is
|
|
249
|
+
// a claim about nothing. The lines are indented beneath it so the heading reads as one.
|
|
250
|
+
const describeSection = async (section, images, now) => {
|
|
251
|
+
const described = await mapWithConcurrency(section.findings, REGISTRY_CONCURRENCY, async (finding) => describeLine(finding, section.repair, now));
|
|
252
|
+
const body = [...described, ...images];
|
|
253
|
+
return body.length === 0
|
|
254
|
+
? []
|
|
255
|
+
: [section.heading, ...body.map((line) => `${INDENT}${line}`)];
|
|
256
|
+
};
|
|
257
|
+
// A blank line between groups and nothing else, so a two-group report is two paragraphs rather than
|
|
258
|
+
// a heading lost in the middle of a list.
|
|
259
|
+
const separated = (groups) => groups
|
|
260
|
+
.filter((group) => group.length > 0)
|
|
261
|
+
.flatMap((group, index) => index === 0 ? group : ['', ...group]);
|
|
262
|
+
// The groups are described one after another rather than all at once, so the registry sees one
|
|
263
|
+
// group's lookups at a time; only the project's own group asks it anything.
|
|
264
|
+
const ONE_GROUP_AT_A_TIME = 1;
|
|
265
|
+
const describeUpdates = async (reported, ownership, images, now) => separated(await mapWithConcurrency(sectionFreshnessReport(reported, ownership), ONE_GROUP_AT_A_TIME, async (section) => describeSection(section, section.repair === imageRepair(ownership) ? images.lines : [], now)));
|
|
266
|
+
// Whose version each name is, read from the same map the wiring gate holds a project to. A name in it
|
|
267
|
+
// is one the project declares and may not change, which is the whole difference between the first two
|
|
268
|
+
// groups of the report.
|
|
269
|
+
const ownershipOf = (manifests) => ({
|
|
270
|
+
pinnedByHarness: new Set(Object.keys(harnessDecidedVersions())),
|
|
271
|
+
isHarnessItself: isHarnessRepository(manifests),
|
|
252
272
|
});
|
|
253
273
|
// One lookup per distinct name, fanned back out across the coordinates that share it. A workspace
|
|
254
274
|
// declaring the same analyzer in three manifests must not ask the registry three times.
|
|
@@ -319,21 +339,24 @@ export const dependencyFreshness = async (context) => {
|
|
|
319
339
|
'this gate is fail-closed by design; retry with network access',
|
|
320
340
|
]);
|
|
321
341
|
}
|
|
322
|
-
|
|
323
|
-
|
|
342
|
+
// A coordinate whose newest release is refused is measured up to the last release it may install,
|
|
343
|
+
// never past it: failing a project for not upgrading into a release another gate refuses would leave
|
|
344
|
+
// it no green state at all.
|
|
345
|
+
const scope = scopeFreshness(statuses);
|
|
346
|
+
const notes = [
|
|
347
|
+
...unpublished.map((name) => `note ${name} is not on the public registry, so freshness is not measurable`),
|
|
348
|
+
...scope.refused.map((entry) => `note ${entry.note}`),
|
|
349
|
+
];
|
|
350
|
+
const report = findFreshnessViolations(scope.measurable);
|
|
351
|
+
const updates = await describeUpdates(report.reported, ownershipOf(manifests), images, Date.now());
|
|
324
352
|
if (report.failures.length > 0) {
|
|
325
|
-
return failed(`${String(report.failures.length)} dependency/dependencies are two or more majors behind`, [
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
]);
|
|
353
|
+
return failed(`${String(report.failures.length)} dependency/dependencies are two or more majors behind`, separated([
|
|
354
|
+
report.failures.map((finding) => describeFinding(finding)),
|
|
355
|
+
updates,
|
|
356
|
+
notes,
|
|
357
|
+
]));
|
|
331
358
|
}
|
|
332
|
-
return passed(freshnessSummary(statuses, manifests, report, images), [
|
|
333
|
-
...(await describeUpdates(report.reported, Date.now())),
|
|
334
|
-
...images.lines,
|
|
335
|
-
...notes,
|
|
336
|
-
]);
|
|
359
|
+
return passed(freshnessSummary(statuses, manifests, report, images), separated([updates, notes]));
|
|
337
360
|
};
|
|
338
361
|
const asStrings = (raw) => isArray(raw) ? raw.filter((entry) => typeof entry === 'string') : [];
|
|
339
362
|
const textAt = (raw, key, fallback) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../src/checks/dependencies.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,0GAA0G;AAC1G,uGAAuG;AACvG,4CAA4C;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAEL,QAAQ,EACR,MAAM,EACN,kBAAkB,EAKlB,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,OAAO,EACP,kBAAkB,EAClB,QAAQ,EACR,oBAAoB,EAIpB,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,GAGnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAgB,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC1F,OAAO,EACL,MAAM,EAEN,MAAM,EAEN,GAAG,EACH,cAAc,EACd,UAAU,GACX,MAAM,YAAY,CAAA;AACnB,OAAO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AAC,mCAAmC,MAAM,CAAC,yBAAyB,CAAC,oBAAoB,CAAC;gBAC5F,CAAC,CAAC,EAAE,CAAC;YACP,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACjE,+DAA+D;SAChE,CAAC,CAAA;IACJ,CAAC;IACD,MAAM,MAAM,GAAwB,oBAAoB,CACtD,UAAU,EACV,OAAO,CAAC,QAAQ,CAAC,sBAAsB,EACvC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,EACtC,kBAAkB,CACnB,CAAA;IACD,MAAM,QAAQ,GAAsB;QAClC,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CACxB,CAAC,QAAkB,EAAU,EAAE,CAC7B,GAAG,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,OAAO,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,KAAK,EAAE,CACtF;QACD,GAAG,MAAM,CAAC,WAAW;KACtB,CAAA;IACD,qGAAqG;IACrG,mGAAmG;IACnG,mGAAmG;IACnG,mBAAmB;IACnB,OAAO,UAAU,CACf,QAAQ,CAAC,MAAM,GAAG,CAAC;QACjB,CAAC,CAAC,MAAM,CACJ,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,yCAAyC,MAAM,CAAC,SAAS,EAAE,EACrF,QAAQ,CACT;QACH,CAAC,CAAC,MAAM,CACJ,gCAAgC,MAAM,CAAC,SAAS,WAAW,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,qBAAqB,CAC1G,EACL,MAAM,CAAC,MAAM,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// Conformance to the committed `.editorconfig`. The decision lives in governance; this reads the tree.
|
|
2
2
|
//
|
|
3
3
|
// Every file in the working tree is checked except those excluded by role: a binary asset, recognised
|
|
4
|
-
// from its own
|
|
5
|
-
//
|
|
6
|
-
//
|
|
4
|
+
// from its own bytes rather than from its name, and a path the project excludes from the typography
|
|
5
|
+
// rules. The standard's line cap is narrower still, because a cap is a Code Rule written for a person:
|
|
6
|
+
// it binds on authored code, not on prose, which wraps by meaning rather than by column, and not on a
|
|
7
|
+
// path the project declares generated, whose lines nobody here chose.
|
|
7
8
|
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
8
9
|
import path from 'node:path';
|
|
9
|
-
import {
|
|
10
|
+
import { findEditorconfigViolations, isBinary, isLineCapEnforced, matchesRole, parseEditorconfig, } from '@ploaness/governance';
|
|
10
11
|
import { workingTreeFiles } from '../context.js';
|
|
11
12
|
import { failed, passed } from '../exec.js';
|
|
12
13
|
const CONFIG_FILE = '.editorconfig';
|
|
@@ -30,7 +31,7 @@ export const editorconfig = (context) => {
|
|
|
30
31
|
.filter((file) => !matchesRole(file, context.settings.typographyExclusions))
|
|
31
32
|
.map((file) => ({ file, bytes: readFileSync(path.join(context.root, file)) }))
|
|
32
33
|
.filter((entry) => !isBinary(entry.bytes));
|
|
33
|
-
const findings = readable.flatMap((entry) => findEditorconfigViolations(entry.bytes.toString('utf8'), rules,
|
|
34
|
+
const findings = readable.flatMap((entry) => findEditorconfigViolations(entry.bytes.toString('utf8'), rules, isLineCapEnforced(entry.file, context.settings.generatedArtefacts)).map((violation) => `${entry.file}:${String(violation.line)} ${violation.reason}`));
|
|
34
35
|
const checked = readable.length;
|
|
35
36
|
return findings.length > 0
|
|
36
37
|
? failed(`${String(findings.length)} formatting violation(s)`, findings)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorconfig.js","sourceRoot":"","sources":["../../src/checks/editorconfig.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,EAAE;AACF,sGAAsG;AACtG,
|
|
1
|
+
{"version":3,"file":"editorconfig.js","sourceRoot":"","sources":["../../src/checks/editorconfig.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,EAAE;AACF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in one place reaches the others it has to.
|
|
5
5
|
*
|
|
6
|
-
* A repository that reads no variable, ships no compose file, and runs no verifying
|
|
7
|
-
* an empty set rather than being declared inapplicable - the same shape the
|
|
8
|
-
* for the same reason: the day one of those appears it is already checked.
|
|
6
|
+
* A repository that reads no variable, ships no compose file, builds no image, and runs no verifying
|
|
7
|
+
* workflow passes over an empty set rather than being declared inapplicable - the same shape the
|
|
8
|
+
* container gate takes, and for the same reason: the day one of those appears it is already checked.
|
|
9
9
|
* @param repository the repository being judged, and the members whose modules it holds.
|
|
10
10
|
* @returns the gate result.
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/checks/environment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/checks/environment.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAe,KAAK,UAAU,IAAI,IAAI,EAAoB,MAAM,eAAe,CAAA;AACtF,OAAO,EAAU,KAAK,UAAU,EAAU,MAAM,YAAY,CAAA;AA4E5D;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GAAI,YAAY,IAAI,KAAG,UAc9C,CAAA"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
// The environment-coherence gate. It reads
|
|
1
|
+
// The environment-coherence gate. It reads five kinds of file and calls one pure function; every
|
|
2
2
|
// decision is in packages/governance/src/environment-coherence.ts.
|
|
3
3
|
import { existsSync, readFileSync } from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import { composeProjectsIn, ENVIRONMENT_EXAMPLE_FILES, findEnvironmentViolations, VALIDATED_ENVIRONMENT_MODULE, } from '@ploaness/governance';
|
|
5
|
+
import { BUILD_CONFIGURATION_FILES, composeProjectsIn, dockerfilesBuilding, dockerfilesIn, ENVIRONMENT_EXAMPLE_FILES, findEnvironmentViolations, VALIDATED_ENVIRONMENT_MODULE, workflowsIn, } from '@ploaness/governance';
|
|
6
6
|
import { workingTreeFiles } from '../context.js';
|
|
7
7
|
import { failed, passed } from '../exec.js';
|
|
8
|
-
const WORKFLOW_DIRECTORY = path.join('.github', 'workflows');
|
|
9
|
-
const WORKFLOW_SUFFIXES = ['.yml', '.yaml'];
|
|
10
8
|
const readIfPresent = (root, relativePath) => {
|
|
11
9
|
const file = path.join(root, relativePath);
|
|
12
10
|
return existsSync(file) ? readFileSync(file, 'utf8') : undefined;
|
|
@@ -22,23 +20,39 @@ const appSources = (repository) => repository.members
|
|
|
22
20
|
.map((member) => readIfPresent(repository.root, path.join(member.path, VALIDATED_ENVIRONMENT_MODULE)))
|
|
23
21
|
.filter(isPresent);
|
|
24
22
|
const composeSources = (repository) => composeProjectsIn(workingTreeFiles(repository.root)).map((project) => readFileSync(path.join(repository.root, project.file), 'utf8'));
|
|
25
|
-
// Discovered
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
const workflows = (repository) => workingTreeFiles(repository.root)
|
|
29
|
-
.filter((file) => file.startsWith(`${WORKFLOW_DIRECTORY}${path.sep}`) &&
|
|
30
|
-
WORKFLOW_SUFFIXES.some((suffix) => file.endsWith(suffix)))
|
|
31
|
-
.map((file) => ({
|
|
23
|
+
// Discovered by the same rule the blocklist gate reads workflows by, so the two never disagree about
|
|
24
|
+
// what a workflow is.
|
|
25
|
+
const workflows = (repository) => workflowsIn(workingTreeFiles(repository.root)).map((file) => ({
|
|
32
26
|
file,
|
|
33
27
|
content: readFileSync(path.join(repository.root, file), 'utf8'),
|
|
34
28
|
}));
|
|
29
|
+
// Discovered by the same rule the container gate reads Dockerfiles by, for the same reason.
|
|
30
|
+
const dockerfileSources = (repository) => dockerfilesIn(workingTreeFiles(repository.root)).map((file) => ({
|
|
31
|
+
file,
|
|
32
|
+
content: readFileSync(path.join(repository.root, file), 'utf8'),
|
|
33
|
+
}));
|
|
34
|
+
// The files whose reads a build inlines: the validated module, and the framework configuration at the
|
|
35
|
+
// member's own root. Per member, because an image is built per member - what one member's build inlines
|
|
36
|
+
// says nothing about the arguments a sibling's image declares.
|
|
37
|
+
const BUILD_SOURCE_FILES = [
|
|
38
|
+
VALIDATED_ENVIRONMENT_MODULE,
|
|
39
|
+
...BUILD_CONFIGURATION_FILES,
|
|
40
|
+
];
|
|
41
|
+
const builds = (repository) => {
|
|
42
|
+
const dockerfiles = dockerfileSources(repository);
|
|
43
|
+
const memberPaths = repository.members.map((member) => member.path);
|
|
44
|
+
return repository.members.map((member) => ({
|
|
45
|
+
sources: BUILD_SOURCE_FILES.map((relative) => readIfPresent(repository.root, path.join(member.path, relative))).filter(isPresent),
|
|
46
|
+
dockerfiles: dockerfilesBuilding(member.path, memberPaths, dockerfiles),
|
|
47
|
+
}));
|
|
48
|
+
};
|
|
35
49
|
const describe = (violation) => `${violation.name}: ${violation.reason}`;
|
|
36
50
|
/**
|
|
37
51
|
* Every environment variable the repository declares in one place reaches the others it has to.
|
|
38
52
|
*
|
|
39
|
-
* A repository that reads no variable, ships no compose file, and runs no verifying
|
|
40
|
-
* an empty set rather than being declared inapplicable - the same shape the
|
|
41
|
-
* for the same reason: the day one of those appears it is already checked.
|
|
53
|
+
* A repository that reads no variable, ships no compose file, builds no image, and runs no verifying
|
|
54
|
+
* workflow passes over an empty set rather than being declared inapplicable - the same shape the
|
|
55
|
+
* container gate takes, and for the same reason: the day one of those appears it is already checked.
|
|
42
56
|
* @param repository the repository being judged, and the members whose modules it holds.
|
|
43
57
|
* @returns the gate result.
|
|
44
58
|
*/
|
|
@@ -48,6 +62,7 @@ export const environment = (repository) => {
|
|
|
48
62
|
example: exampleFile(repository),
|
|
49
63
|
composeSources: composeSources(repository),
|
|
50
64
|
workflows: workflows(repository),
|
|
65
|
+
builds: builds(repository),
|
|
51
66
|
});
|
|
52
67
|
return violations.length > 0
|
|
53
68
|
? failed(`${String(violations.length)} environment variable(s) are declared in one place and missing from another`, violations.map((violation) => describe(violation)))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/checks/environment.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,mEAAmE;AACnE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/checks/environment.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,mEAAmE;AACnE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EACL,yBAAyB,EAEzB,iBAAiB,EAEjB,mBAAmB,EACnB,aAAa,EACb,yBAAyB,EAEzB,yBAAyB,EAEzB,4BAA4B,EAE5B,WAAW,GACZ,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAwC,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACtF,OAAO,EAAE,MAAM,EAAmB,MAAM,EAAE,MAAM,YAAY,CAAA;AAE5D,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,YAAoB,EAAsB,EAAE;IAC/E,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;IAClD,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAClE,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,KAAyB,EAAmB,EAAE,CAAC,KAAK,KAAK,SAAS,CAAA;AAErF,wGAAwG;AACxG,uGAAuG;AACvG,sCAAsC;AACtC,MAAM,WAAW,GAAG,CAAC,UAAgB,EAAsB,EAAE,CAC3D,yBAAyB,CAAC,GAAG,CAAC,CAAC,SAAiB,EAAsB,EAAE,CACtE,aAAa,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CAC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AAS,CAAC,UAAU,CAAC;QAChC,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC;KAC3B,CAAC,CAAA;IACF,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC;QAC1B,CAAC,CAAC,MAAM,CACJ,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,6EAA6E,EACzG,UAAU,CAAC,GAAG,CAAC,CAAC,SAA+B,EAAU,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CACjF;QACH,CAAC,CAAC,MAAM,CAAC,qEAAqE,CAAC,CAAA;AACnF,CAAC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Context } from '../context.js';
|
|
2
|
+
import { type GateResult } from '../exec.js';
|
|
3
|
+
/** Judge every OpenTofu and Terraform source the repository tracks. */
|
|
4
|
+
export declare const infrastructure: (context: Context) => GateResult;
|
|
5
|
+
//# sourceMappingURL=infra.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infra.d.ts","sourceRoot":"","sources":["../../src/checks/infra.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,KAAK,OAAO,EAAoB,MAAM,eAAe,CAAA;AAC9D,OAAO,EAGL,KAAK,UAAU,EAKhB,MAAM,YAAY,CAAA;AA8OnB,uEAAuE;AACvE,eAAO,MAAM,cAAc,GAAI,SAAS,OAAO,KAAG,UAmBjD,CAAA"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// OpenTofu and Terraform, judged by two readers with one owner each.
|
|
2
|
+
//
|
|
3
|
+
// The pattern rules decide what text can decide and nothing more; the curated analyzer decides what
|
|
4
|
+
// needs a resource graph. Both run here because a project that ships infrastructure ships it as code,
|
|
5
|
+
// and until now the harness read those files for secrets and whitespace and nothing else.
|
|
6
|
+
//
|
|
7
|
+
// Before either reader, the providers the tree declares are classified. A `--check` id that binds to
|
|
8
|
+
// no resource in the tree matches nothing and raises no error, so over a cloud the catalogue did not
|
|
9
|
+
// cover the analyzer exits 0 and a gate that did not look would report curated checks that never ran.
|
|
10
|
+
// A provider nobody classified is refused instead, and a provider the analyzer ships no check for is
|
|
11
|
+
// passed on the pattern rules with a summary that says exactly that.
|
|
12
|
+
import { readFileSync } from 'node:fs';
|
|
13
|
+
import path from 'node:path';
|
|
14
|
+
import { CONTAINER_IMAGES, checkovCheckList, checkovConfigsIn, checksFor, classifyProviders, failedCheckCount, findTerraformViolations, providerDeclarationsIn, providersOf, resourceCountOf, terraformFilesIn, } from '@ploaness/governance';
|
|
15
|
+
import { workingTreeFiles } from '../context.js';
|
|
16
|
+
import { asFindings, failed, passed, run, withOutput, } from '../exec.js';
|
|
17
|
+
import { acquireImage, dockerFault } from './container-run.js';
|
|
18
|
+
const CHECKOV_IMAGE = CONTAINER_IMAGES.checkov;
|
|
19
|
+
const INFRA_GATE = 'the infrastructure gate';
|
|
20
|
+
/** checkov exits 1 when a check failed; anything higher means it stopped before deciding. */
|
|
21
|
+
const CHECKOV_FINDINGS = 1;
|
|
22
|
+
// Each source is read once and handed to both readers.
|
|
23
|
+
const readSources = (context, files) => files.map((file) => ({
|
|
24
|
+
file,
|
|
25
|
+
text: readFileSync(path.join(context.root, file), 'utf8'),
|
|
26
|
+
}));
|
|
27
|
+
const patternFindingsIn = (sources) => sources.flatMap((source) => findTerraformViolations(source.text).map((violation) => `${source.file}:${String(violation.line)} [${violation.rule}] ${violation.reason}`));
|
|
28
|
+
const declarationsIn = (sources) => sources.flatMap((source) => providerDeclarationsIn(source.text).map((declaration) => ({
|
|
29
|
+
...declaration,
|
|
30
|
+
file: source.file,
|
|
31
|
+
})));
|
|
32
|
+
const listed = (names) => names.join(', ');
|
|
33
|
+
const matchesFileAndProvider = (left, right) => left.file === right.file && left.provider === right.provider;
|
|
34
|
+
// One finding per file and provider: the first line that declares it is enough to act on.
|
|
35
|
+
const firstDeclarations = (declarations, providers) => declarations.filter((declaration, index) => providers.includes(declaration.provider) &&
|
|
36
|
+
declarations.findIndex((other) => matchesFileAndProvider(other, declaration)) === index);
|
|
37
|
+
// Refusing to guess is the point. The repair sits in ploaness rather than in the project, and the
|
|
38
|
+
// finding says so rather than sending an agent looking for an argument to change. The pattern rules
|
|
39
|
+
// already ran, and their findings are real, so they are reported beneath.
|
|
40
|
+
const unclassifiedFailure = (standing, declarations, patterns) => failed(`provider(s) this harness has not classified: ${listed(standing.unclassified)}`, [
|
|
41
|
+
...firstDeclarations(declarations, standing.unclassified).map((declaration) => `${declaration.file}:${String(declaration.line)} declares ${declaration.subject}, and ` +
|
|
42
|
+
`this harness has not classified the ${declaration.provider} provider`),
|
|
43
|
+
'classify each provider in ploaness (packages/governance/src/checkov-policy.ts); the harness ' +
|
|
44
|
+
'refuses to guess whether the analyzer covers it',
|
|
45
|
+
...(patterns.length === 0 ? [] : ['the pattern rules also found the following:', ...patterns]),
|
|
46
|
+
]);
|
|
47
|
+
// Why no analyzer ran, in the summary's own words. Only the standings actually present are named.
|
|
48
|
+
const standingClause = (standing) => {
|
|
49
|
+
const clauses = [
|
|
50
|
+
...(standing.unsupported.length === 0
|
|
51
|
+
? []
|
|
52
|
+
: [`the analyzer ships no check for ${listed(standing.unsupported)}`]),
|
|
53
|
+
...(standing.audited.length === 0
|
|
54
|
+
? []
|
|
55
|
+
: [`no check for ${listed(standing.audited)} met the rubric`]),
|
|
56
|
+
];
|
|
57
|
+
return clauses.length === 0
|
|
58
|
+
? `only utility providers are declared (${listed(standing.utility)})`
|
|
59
|
+
: clauses.join('; ');
|
|
60
|
+
};
|
|
61
|
+
// `21 aws curated check(s)`, or `21 aws and 30 google curated check(s)`: the count of what could have
|
|
62
|
+
// applied, which is the claim a pass is entitled to make.
|
|
63
|
+
const checkClause = (curated) => `${curated
|
|
64
|
+
.map((provider) => `${String(checksFor([provider]).length)} ${provider}`)
|
|
65
|
+
.join(' and ')} curated check(s)`;
|
|
66
|
+
const patternVerdict = (patterns, summary) => patterns.length === 0
|
|
67
|
+
? passed(summary)
|
|
68
|
+
: failed(`${String(patterns.length)} infrastructure defect(s)`, patterns);
|
|
69
|
+
// checkov reserves 1 for a failed check. Every higher status is the tool stopping before it decided
|
|
70
|
+
// anything, and reading that as "the infrastructure is fine" - or as a defect - are both wrong.
|
|
71
|
+
const checkovFault = (result) => result.code === 0 || result.code === CHECKOV_FINDINGS
|
|
72
|
+
? undefined
|
|
73
|
+
: failed(`${INFRA_GATE} could not complete its analyzer run`, asFindings(result.output));
|
|
74
|
+
// The pattern rules already ran when the image turns out to be unavailable, and their findings are
|
|
75
|
+
// real. Reporting the docker failure alone would throw away work that cost nothing, so both are
|
|
76
|
+
// returned with a line saying which half of the gate actually ran.
|
|
77
|
+
const withPatternFindings = (unavailable, patterns) => patterns.length === 0
|
|
78
|
+
? unavailable
|
|
79
|
+
: failed(unavailable.summary, [
|
|
80
|
+
...unavailable.findings,
|
|
81
|
+
'the pattern rules ran and found the following; the analyzer did not:',
|
|
82
|
+
...patterns,
|
|
83
|
+
]);
|
|
84
|
+
// `--workdir /` rather than the mounted tree, so nothing the project ships is the analyzer's working
|
|
85
|
+
// directory. `--framework terraform` keeps this gate to the one thing it owns: the dockerfile, secrets
|
|
86
|
+
// and workflow frameworks belong to gates that already run them. Never `--soft-fail`, which forces
|
|
87
|
+
// exit 0, and never `--no-fail-on-crash`, which turns a crash into a pass.
|
|
88
|
+
//
|
|
89
|
+
// The whole catalogue is sent, not the subset for the providers found. A check never fires on a
|
|
90
|
+
// resource type it does not bind to, so the verdict is the same either way - and a detection miss
|
|
91
|
+
// then costs a wrong count in the summary rather than a check that silently did not run.
|
|
92
|
+
//
|
|
93
|
+
// `--skip-download` keeps the run off the network. Without it checkov fetches guideline mappings from
|
|
94
|
+
// its vendor on every run, and when that fetch fails the traceback lands in the output this gate
|
|
95
|
+
// reads line by line as findings. The checks themselves ship in the image; nothing judged depends on
|
|
96
|
+
// the download.
|
|
97
|
+
const runCheckov = (context) => run('docker', [
|
|
98
|
+
'run',
|
|
99
|
+
'--rm',
|
|
100
|
+
'-v',
|
|
101
|
+
`${context.root}:/repo:ro`,
|
|
102
|
+
'--workdir',
|
|
103
|
+
'/',
|
|
104
|
+
CHECKOV_IMAGE,
|
|
105
|
+
'--directory',
|
|
106
|
+
'/repo',
|
|
107
|
+
'--framework',
|
|
108
|
+
'terraform',
|
|
109
|
+
'--check',
|
|
110
|
+
checkovCheckList(),
|
|
111
|
+
'--skip-download',
|
|
112
|
+
'--compact',
|
|
113
|
+
'--quiet',
|
|
114
|
+
'--output',
|
|
115
|
+
'cli',
|
|
116
|
+
], { cwd: context.root });
|
|
117
|
+
const analyze = (context, patterns, passSummary) => {
|
|
118
|
+
const unavailable = acquireImage(context, CHECKOV_IMAGE, INFRA_GATE);
|
|
119
|
+
if (unavailable !== undefined) {
|
|
120
|
+
return withPatternFindings(unavailable, patterns);
|
|
121
|
+
}
|
|
122
|
+
const result = runCheckov(context);
|
|
123
|
+
const faulted = dockerFault(context, CHECKOV_IMAGE, INFRA_GATE, result) ?? checkovFault(result);
|
|
124
|
+
if (faulted !== undefined) {
|
|
125
|
+
return faulted;
|
|
126
|
+
}
|
|
127
|
+
return withOutput(analyzerVerdict(result, patterns, passSummary), result.output);
|
|
128
|
+
};
|
|
129
|
+
// The summary counts defects, not lines. checkov's output is reported in full beneath, but it spends
|
|
130
|
+
// several lines on each failed check, so the count comes from the tally it prints. Exit 1 with no
|
|
131
|
+
// tally is output this gate cannot read, and is failed as such rather than counted.
|
|
132
|
+
const analyzerVerdict = (result, patterns, passSummary) => {
|
|
133
|
+
if (result.code !== CHECKOV_FINDINGS) {
|
|
134
|
+
return patternVerdict(patterns, passSummary);
|
|
135
|
+
}
|
|
136
|
+
const failures = failedCheckCount(result.output);
|
|
137
|
+
if (failures === undefined) {
|
|
138
|
+
return failed(`${INFRA_GATE} could not read the analyzer's summary`, asFindings(result.output));
|
|
139
|
+
}
|
|
140
|
+
return failed(`${String(patterns.length + failures)} infrastructure defect(s)`, [
|
|
141
|
+
...patterns,
|
|
142
|
+
...asFindings(result.output),
|
|
143
|
+
]);
|
|
144
|
+
};
|
|
145
|
+
// What the tree declares decides whether the analyzer runs at all. A tree of variables and modules
|
|
146
|
+
// declares nothing it could judge; a tree on a cloud it has no check for would pass without looking.
|
|
147
|
+
// Neither pulls an image, and neither claims a check it did not run.
|
|
148
|
+
const judge = (context, sources, declarations, standing) => {
|
|
149
|
+
const patterns = patternFindingsIn(sources);
|
|
150
|
+
if (standing.unclassified.length > 0) {
|
|
151
|
+
return unclassifiedFailure(standing, declarations, patterns);
|
|
152
|
+
}
|
|
153
|
+
const files = `${String(sources.length)} infrastructure file(s)`;
|
|
154
|
+
const resources = resourceCountOf(declarations);
|
|
155
|
+
if (resources === 0) {
|
|
156
|
+
return patternVerdict(patterns, `${files} declare no resource this harness can judge; the pattern rules pass`);
|
|
157
|
+
}
|
|
158
|
+
if (standing.curated.length === 0) {
|
|
159
|
+
return patternVerdict(patterns, `${files} pass the pattern rules; ${standingClause(standing)}`);
|
|
160
|
+
}
|
|
161
|
+
return analyze(context, patterns, `${files} declaring ${String(resources)} resource(s) pass ` +
|
|
162
|
+
`${checkClause(standing.curated)} and the pattern rules`);
|
|
163
|
+
};
|
|
164
|
+
/** Judge every OpenTofu and Terraform source the repository tracks. */
|
|
165
|
+
export const infrastructure = (context) => {
|
|
166
|
+
const tracked = workingTreeFiles(context.root);
|
|
167
|
+
const files = terraformFilesIn(tracked);
|
|
168
|
+
// No infrastructure means no container: a project that ships none never needs the image.
|
|
169
|
+
if (files.length === 0) {
|
|
170
|
+
return passed('the project ships no infrastructure definition');
|
|
171
|
+
}
|
|
172
|
+
// A committed configuration would turn the curated checks off from inside the tree they judge, which
|
|
173
|
+
// is the shadowing the harness refuses for every other analyzer.
|
|
174
|
+
const shadowing = checkovConfigsIn(tracked);
|
|
175
|
+
if (shadowing.length > 0) {
|
|
176
|
+
return failed('a local analyzer configuration would shadow the infrastructure rules', [
|
|
177
|
+
...shadowing.map((file) => `${file} configures the analyzer this gate runs`),
|
|
178
|
+
'delete it; the checks this harness enables are not a project setting',
|
|
179
|
+
]);
|
|
180
|
+
}
|
|
181
|
+
const sources = readSources(context, files);
|
|
182
|
+
const declarations = declarationsIn(sources);
|
|
183
|
+
return judge(context, sources, declarations, classifyProviders(providersOf(declarations)));
|
|
184
|
+
};
|
|
185
|
+
//# sourceMappingURL=infra.js.map
|