@norskvideo/ctl-dev-kit 0.2.139 → 0.2.140
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.
|
@@ -151,8 +151,9 @@ export function ctlPackageProblem(flake: string): string | undefined {
|
|
|
151
151
|
// dprint.json is canonical-plus-extension: the shared config is verbatim, but a
|
|
152
152
|
// repo may exclude paths only it has (e.g. probe's generated components/lib/)
|
|
153
153
|
// inside a sanctioned marker block at the head of `excludes`. Everything outside
|
|
154
|
-
// the block is byte-compared; inside, only well-formed `"entry",` lines
|
|
155
|
-
//
|
|
154
|
+
// the block is byte-compared; inside, only well-formed `"entry",` lines and
|
|
155
|
+
// whole-line `//` comments (saying why a path is excluded) are allowed, so the
|
|
156
|
+
// block can't smuggle arbitrary config past the byte check.
|
|
156
157
|
export const DPRINT_BEGIN = "// BEGIN repo-specific excludes";
|
|
157
158
|
export const DPRINT_END = "// END repo-specific excludes";
|
|
158
159
|
|
|
@@ -179,9 +180,9 @@ function dprintProblem(actual: string, canonical: string): string | undefined {
|
|
|
179
180
|
if (masked(a) !== masked(c)) {
|
|
180
181
|
return `dprint.json has drifted from @norskvideo/ctl-dev-kit conventions/dprint.base.jsonc outside the repo-specific excludes block (${firstDiffLine(masked(a), masked(c))}). ${RESYNC}`;
|
|
181
182
|
}
|
|
182
|
-
const badLine = a.body.find((l) => !/^\s*"[^"]*"
|
|
183
|
+
const badLine = a.body.find((l) => !/^\s*("[^"]*",|\/\/.*)$/.test(l));
|
|
183
184
|
if (badLine !== undefined) {
|
|
184
|
-
return `dprint.json repo-specific excludes block has a malformed line (${JSON.stringify(badLine.trim())}) — one double-quoted exclude entry per line, each ending with a comma.`;
|
|
185
|
+
return `dprint.json repo-specific excludes block has a malformed line (${JSON.stringify(badLine.trim())}) — one double-quoted exclude entry per line, each ending with a comma, or a whole-line // comment.`;
|
|
185
186
|
}
|
|
186
187
|
return undefined;
|
|
187
188
|
}
|