paperlint 19.0.0 → 19.0.2
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/.claude-plugin/plugin.json +1 -1
- package/CLAUDE.md +2 -2
- package/dist/adapters/eslint/index.d.ts +13 -0
- package/dist/adapters/eslint/index.d.ts.map +1 -0
- package/dist/adapters/eslint/index.js +44 -0
- package/dist/adapters/eslint/index.js.map +1 -0
- package/dist/adapters/eslint/report.io.d.ts +15 -0
- package/dist/adapters/eslint/report.io.d.ts.map +1 -0
- package/dist/adapters/eslint/report.io.js +48 -0
- package/dist/adapters/eslint/report.io.js.map +1 -0
- package/dist/cli.d.ts +7 -12
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +80 -121
- package/dist/cli.js.map +1 -1
- package/dist/domain/submission-lint.d.ts +29 -0
- package/dist/domain/submission-lint.d.ts.map +1 -0
- package/dist/domain/submission-lint.js +84 -0
- package/dist/domain/submission-lint.js.map +1 -0
- package/dist/folder-layout-hook.js +1 -1
- package/dist/hooks-notice.d.ts +2 -0
- package/dist/hooks-notice.d.ts.map +1 -1
- package/dist/hooks-notice.js +4 -1
- package/dist/hooks-notice.js.map +1 -1
- package/dist/ports/submission-lint.d.ts +6 -0
- package/dist/ports/submission-lint.d.ts.map +1 -0
- package/dist/ports/submission-lint.js +2 -0
- package/dist/ports/submission-lint.js.map +1 -0
- package/dist/structure.d.ts +17 -1
- package/dist/structure.d.ts.map +1 -1
- package/dist/structure.js.map +1 -1
- package/dist/submission-confirm-hook.d.ts +8 -1
- package/dist/submission-confirm-hook.d.ts.map +1 -1
- package/dist/submission-confirm-hook.js +75 -20
- package/dist/submission-confirm-hook.js.map +1 -1
- package/dist/submission.d.ts +5 -0
- package/dist/submission.d.ts.map +1 -1
- package/dist/submission.js +46 -7
- package/dist/submission.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/install.md +4 -4
- package/docs/layout.md +0 -1
- package/docs/submission.md +19 -8
- package/eslint.config.mjs +2 -0
- package/hooks/hooks.harness.ts +2 -140
- package/hooks/paper-skills-nudge.hook.mjs +0 -6
- package/lib/paper-config.harness.mjs +1 -2
- package/package.json +1 -1
- package/plugin/hooks/hooks.json +0 -9
- package/scripts/eslint-file-length.mjs +117 -0
- package/src/adapters/eslint/index.test.ts +152 -0
- package/src/adapters/eslint/index.ts +89 -0
- package/src/adapters/eslint/report.io.ts +82 -0
- package/src/cli.harness.mjs +9 -8
- package/src/cli.test.ts +4 -4
- package/src/cli.ts +110 -144
- package/src/domain/submission-lint.test.ts +211 -0
- package/src/domain/submission-lint.ts +166 -0
- package/src/folder-layout-hook.ts +1 -1
- package/src/hooks-notice.test.ts +2 -2
- package/src/hooks-notice.ts +10 -1
- package/src/hooks-settings.harness.ts +8 -8
- package/src/ports/submission-lint.ts +10 -0
- package/src/structure.ts +2 -4
- package/src/submission-confirm-hook-lint.test.ts +47 -0
- package/src/submission-confirm-hook.test.ts +73 -6
- package/src/submission-confirm-hook.ts +133 -28
- package/src/submission-fields-run.test.ts +1 -1
- package/src/submission-new.test.ts +4 -2
- package/src/submission-update.test.ts +16 -11
- package/src/submission.ts +62 -8
- package/src/types.ts +2 -0
- package/hooks/paper-status-gates.hook.mjs +0 -158
- package/hooks/paper-status-gates.sh +0 -93
- package/hooks/paper-status-gates.test.ts +0 -101
package/CLAUDE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- vigiles:sha256:
|
|
1
|
+
<!-- vigiles:sha256:bd5aa64eb5260e8f compiled from CLAUDE.md.spec.ts -->
|
|
2
2
|
|
|
3
3
|
# CLAUDE.md
|
|
4
4
|
|
|
@@ -107,7 +107,7 @@ Before writing machinery, **run the thing you are about to replace and paste its
|
|
|
107
107
|
|
|
108
108
|
### An Optional Tool Stays Out Of The Way
|
|
109
109
|
|
|
110
|
-
**Guidance only** — Everything opt-in (a rule off by default, a set, a command that wraps an outside service, a skill, a hook) is judged by how little it costs an author who does not use it, and one who does it their own way. Off means silent: no finding, no notice, no prompt. Turned on and missing what it needs, it says so once, naming the one command or setting that answers it. It works with the author's own tool: a wrapper (an upload, a portal) writes the same documented file the author could write by hand or by script, and the rule reads that file, not the wrapper. Lint never calls the network. Nothing opt-in
|
|
110
|
+
**Guidance only** — Everything opt-in (a rule off by default, a set, a command that wraps an outside service, a skill, a hook) is judged by how little it costs an author who does not use it, and one who does it their own way. Off means silent: no finding, no notice, no prompt. Turned on and missing what it needs, it says so once, naming the one command or setting that answers it. It works with the author's own tool: a wrapper (an upload, a portal) writes the same documented file the author could write by hand or by script, and the rule reads that file, not the wrapper. Lint never calls the network. Nothing opt-in ships at `error`: a set or rule paperlint documents as opt-in is turned on at `warn`, and only a severity the author writes can fail a build or block a submission (decided 2026-11-23, #635). The author asked for this on 2026-11-21: "good DX, as long as it stays optional" and "not being annoying".
|
|
111
111
|
|
|
112
112
|
### The Linter Is The Core
|
|
113
113
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ESLint } from "eslint";
|
|
2
|
+
import { type Result } from "../../domain/result.ts";
|
|
3
|
+
import { type LintFinding, type PaperSections } from "../../domain/submission-lint.ts";
|
|
4
|
+
import type { SubmissionLinter } from "../../ports/submission-lint.ts";
|
|
5
|
+
export { LINT_FORMAT, lintExitCode, lintResultFor, lintText, printLintResults, } from "./report.io.ts";
|
|
6
|
+
/** ESLint throws when the paths match no files or only ignored files. */
|
|
7
|
+
export declare function isEmptyLintSet(e: unknown): boolean;
|
|
8
|
+
/** Translate ESLint's structured diagnostics at the adapter boundary. */
|
|
9
|
+
export declare function lintFindings(results: readonly ESLint.LintResult[], paperDir: string): Result<readonly LintFinding[], string>;
|
|
10
|
+
export type OnLintResults = (results: readonly ESLint.LintResult[]) => void;
|
|
11
|
+
type RunPaperLint = (paperDir: string, cwd: string, onResults: OnLintResults) => Promise<string>;
|
|
12
|
+
export declare const submissionLinter: (runLint: RunPaperLint, sectionsOf: (paperDir: string) => PaperSections | null) => SubmissionLinter;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/eslint/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,EACL,WAAW,EACX,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AASxB,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAOlD;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAC1B,OAAO,EAAE,SAAS,MAAM,CAAC,UAAU,EAAE,EACrC,QAAQ,EAAE,MAAM,GACf,MAAM,CAAC,SAAS,WAAW,EAAE,EAAE,MAAM,CAAC,CAaxC;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,SAAS,MAAM,CAAC,UAAU,EAAE,KAAK,IAAI,CAAC;AAC5E,KAAK,YAAY,GAAG,CAClB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,aAAa,KACrB,OAAO,CAAC,MAAM,CAAC,CAAC;AAErB,eAAO,MAAM,gBAAgB,GAEzB,SAAS,YAAY,EACrB,YAAY,CAAC,QAAQ,EAAE,MAAM,KAAK,aAAa,GAAG,IAAI,KACrD,gBAmBC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { relative } from "node:path";
|
|
2
|
+
import { flatMap, map, partition } from "remeda";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { err, ok } from "../../domain/result.js";
|
|
5
|
+
import { lintFindingLine, submissionLint, } from "../../domain/submission-lint.js";
|
|
6
|
+
import { messageOf } from "../../domain/text.js";
|
|
7
|
+
export { LINT_FORMAT, lintExitCode, lintResultFor, lintText, printLintResults, } from "./report.io.js";
|
|
8
|
+
const lintFailure = z
|
|
9
|
+
.object({
|
|
10
|
+
messageTemplate: z.string().optional(),
|
|
11
|
+
message: z.string().optional(),
|
|
12
|
+
})
|
|
13
|
+
.catch({});
|
|
14
|
+
/** ESLint throws when the paths match no files or only ignored files. */
|
|
15
|
+
export function isEmptyLintSet(e) {
|
|
16
|
+
const { messageTemplate, message } = lintFailure.parse(e);
|
|
17
|
+
return (messageTemplate === "file-not-found" ||
|
|
18
|
+
messageTemplate === "all-matched-files-ignored" ||
|
|
19
|
+
message?.toLowerCase().includes("no files matching") === true);
|
|
20
|
+
}
|
|
21
|
+
/** Translate ESLint's structured diagnostics at the adapter boundary. */
|
|
22
|
+
export function lintFindings(results, paperDir) {
|
|
23
|
+
const [fatal, findings] = partition(flatMap(results, ({ filePath, messages }) => map(messages, (m) => ({
|
|
24
|
+
...m,
|
|
25
|
+
file: relative(paperDir, filePath).replaceAll("\\", "/") || ".",
|
|
26
|
+
}))), (m) => m.fatal === true);
|
|
27
|
+
return fatal.length === 0
|
|
28
|
+
? ok(findings)
|
|
29
|
+
: err(map(fatal, lintFindingLine).join("\n"));
|
|
30
|
+
}
|
|
31
|
+
export const submissionLinter = (runLint, sectionsOf) => (paperDir, cwd) => new Promise((settle) => {
|
|
32
|
+
const accept = (results) => {
|
|
33
|
+
const findings = lintFindings(results, paperDir);
|
|
34
|
+
settle(findings.ok
|
|
35
|
+
? ok(submissionLint(findings.value, sectionsOf(paperDir)))
|
|
36
|
+
: findings);
|
|
37
|
+
};
|
|
38
|
+
void runLint(paperDir, cwd, accept).then((problem) => {
|
|
39
|
+
settle(err(problem || "paperlint lint did not produce a report"));
|
|
40
|
+
}, (e) => {
|
|
41
|
+
settle(err(messageOf(e)));
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/eslint/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,eAAe,EACf,cAAc,GAGf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC;KACD,KAAK,CAAC,EAAE,CAAC,CAAC;AAEb,yEAAyE;AACzE,MAAM,UAAU,cAAc,CAAC,CAAU;IACvC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1D,OAAO,CACL,eAAe,KAAK,gBAAgB;QACpC,eAAe,KAAK,2BAA2B;QAC/C,OAAO,EAAE,WAAW,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAC9D,CAAC;AACJ,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,YAAY,CAC1B,OAAqC,EACrC,QAAgB;IAEhB,M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GAAG,CAAC,OAAO,IAAI,yCAAyC,CAAC,CAAC,CAAC;IACpE,CAAC,EACD,CAAC,CAAU,EAAE,EAAE;QACb,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ESLint } from "eslint";
|
|
2
|
+
export declare const LINT_FORMAT = "stylish";
|
|
3
|
+
export declare function lintResultFor(file: string, messages: readonly ESLint.LintResult["messages"][number][]): Readonly<ESLint.LintResult>;
|
|
4
|
+
/** Print the venue findings in the same format as the standalone lint command. */
|
|
5
|
+
export declare function lintText(file: string, messages: readonly ESLint.LintResult["messages"][number][]): Promise<string>;
|
|
6
|
+
interface ReportFormat {
|
|
7
|
+
readonly json: boolean;
|
|
8
|
+
readonly structure: readonly ESLint.LintResult[];
|
|
9
|
+
readonly structureText: string;
|
|
10
|
+
readonly log: (line: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function printLintResults(eslint: ESLint, results: readonly ESLint.LintResult[], { json, structure, structureText, log }: ReportFormat): Promise<boolean>;
|
|
13
|
+
export declare function lintExitCode(results: readonly ESLint.LintResult[], hasStructureErrors: boolean, maxWarnings: number, err: (line: string) => void): number;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=report.io.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.io.d.ts","sourceRoot":"","sources":["../../../src/adapters/eslint/report.io.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,eAAO,MAAM,WAAW,YAAY,CAAC;AAErC,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,SAAS,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAE,GACzD,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAa7B;AAED,kFAAkF;AAClF,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,SAAS,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAE,GACzD,OAAO,CAAC,MAAM,CAAC,CAIjB;AAED,UAAU,YAAY;IACpB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,CAAC,UAAU,EAAE,CAAC;IACjD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,SAAS,MAAM,CAAC,UAAU,EAAE,EACrC,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE,YAAY,GACpD,OAAO,CAAC,OAAO,CAAC,CAqBlB;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,SAAS,MAAM,CAAC,UAAU,EAAE,EACrC,kBAAkB,EAAE,OAAO,EAC3B,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC1B,MAAM,CASR"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ESLint } from "eslint";
|
|
2
|
+
import { map, omit, sumBy } from "remeda";
|
|
3
|
+
export const LINT_FORMAT = "stylish";
|
|
4
|
+
export function lintResultFor(file, messages) {
|
|
5
|
+
const errorCount = messages.filter((m) => m.severity === 2).length;
|
|
6
|
+
return {
|
|
7
|
+
filePath: file,
|
|
8
|
+
messages: [...messages],
|
|
9
|
+
suppressedMessages: [],
|
|
10
|
+
errorCount,
|
|
11
|
+
fatalErrorCount: 0,
|
|
12
|
+
warningCount: messages.length - errorCount,
|
|
13
|
+
fixableErrorCount: 0,
|
|
14
|
+
fixableWarningCount: 0,
|
|
15
|
+
usedDeprecatedRules: [],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** Print the venue findings in the same format as the standalone lint command. */
|
|
19
|
+
export async function lintText(file, messages) {
|
|
20
|
+
return (await new ESLint().loadFormatter(LINT_FORMAT)).format([
|
|
21
|
+
lintResultFor(file, messages),
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
export async function printLintResults(eslint, results, { json, structure, structureText, log }) {
|
|
25
|
+
if (json) {
|
|
26
|
+
log(JSON.stringify([...structure, ...map(results, (r) => omit(r, ["stats"]))], null, 1));
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
if (structure.length > 0)
|
|
30
|
+
log(structureText);
|
|
31
|
+
const out = await (await eslint.loadFormatter(LINT_FORMAT)).format([...results]);
|
|
32
|
+
const clean = out.trim() === "" && structure.length === 0;
|
|
33
|
+
log(out.trim() ||
|
|
34
|
+
(clean ? `✓ ${String(results.length)} file(s) checked, no findings` : ""));
|
|
35
|
+
return clean;
|
|
36
|
+
}
|
|
37
|
+
export function lintExitCode(results, hasStructureErrors, maxWarnings, err) {
|
|
38
|
+
if (hasStructureErrors || results.some((r) => r.errorCount > 0))
|
|
39
|
+
return 1;
|
|
40
|
+
if (maxWarnings < 0)
|
|
41
|
+
return 0;
|
|
42
|
+
const warnings = sumBy(results, (r) => r.warningCount);
|
|
43
|
+
if (!(warnings > maxWarnings))
|
|
44
|
+
return 0;
|
|
45
|
+
err(`${String(warnings)} warning(s) exceed the --max-warnings limit of ${String(maxWarnings)}`);
|
|
46
|
+
return 1;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=report.io.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.io.js","sourceRoot":"","sources":["../../../src/adapters/eslint/report.io.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,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{ isMain } from "../skills/paper-pipeline/scripts/consumer.mjs";
|
|
28
28
|
export { isMain };
|
|
29
29
|
import type { Args, PaperlintConfig, ConfigRead } from "./types.ts";
|
|
30
|
+
import { checkStructure } from "./structure.ts";
|
|
30
31
|
import { runToolchain } from "./toolchain.ts";
|
|
31
|
-
|
|
32
|
+
export { lintText } from "./adapters/eslint/index.ts";
|
|
32
33
|
import type { CheckReferences } from "./ports/check-references.ts";
|
|
33
34
|
import type { PaperScope } from "./paper-files.ts";
|
|
34
35
|
import { type TexRequirements } from "./tex-requirements.ts";
|
|
@@ -40,7 +41,7 @@ export { nextSteps } from "./init.ts";
|
|
|
40
41
|
import { type LinkReport } from "./link-skills.ts";
|
|
41
42
|
import type { ProjectInstall } from "./ports/project-install.ts";
|
|
42
43
|
import type { ClaudeCode } from "./ports/claude-code.ts";
|
|
43
|
-
import { type Upload } from "./submission-confirm-hook.ts";
|
|
44
|
+
import { type Send, type Upload } from "./submission-confirm-hook.ts";
|
|
44
45
|
/** The config the user would otherwise write by hand. The data comes from `opts`, the mechanism is here. */
|
|
45
46
|
export declare function buildConfig(opts: PaperlintConfig | undefined, texLanguage: unknown, papers?: PaperScope): ConfigBlock[];
|
|
46
47
|
export declare function eslintConfig(blocks: readonly ConfigBlock[]): Linter.Config[];
|
|
@@ -133,10 +134,7 @@ export declare function toPaths(papers: unknown): string[];
|
|
|
133
134
|
* (a flag missing its value, an unknown flag, a stray operand), so `submission-confirm` says it
|
|
134
135
|
* cannot tell rather than guess.
|
|
135
136
|
*/
|
|
136
|
-
export declare function submissionSend(words: readonly string[]):
|
|
137
|
-
readonly paper: string | null;
|
|
138
|
-
readonly pdf: string | null;
|
|
139
|
-
} | null;
|
|
137
|
+
export declare function submissionSend(words: readonly string[]): Send | null;
|
|
140
138
|
/**
|
|
141
139
|
* The words after `artifact`, read by this CLI's own parser, for an upload: the file it uploads, the
|
|
142
140
|
* paper (null for the current folder), and the host and project it goes to — or null when they would
|
|
@@ -261,7 +259,8 @@ export declare function initTexLive(a: Args, { log, err, cwd, }: {
|
|
|
261
259
|
readonly installed: () => boolean;
|
|
262
260
|
readonly install: () => number;
|
|
263
261
|
};
|
|
264
|
-
|
|
262
|
+
type LintResults = (results: readonly ESLint.LintResult[], structure: Readonly<ReturnType<typeof checkStructure>>) => void;
|
|
263
|
+
export declare function run(argv: readonly string[], { log, err, cwd, now, checkReferences, loadTexLanguage, skillLinks, install, claude, onLintResults, }?: {
|
|
265
264
|
log?: typeof console.log;
|
|
266
265
|
err?: typeof console.error;
|
|
267
266
|
cwd?: string;
|
|
@@ -283,10 +282,6 @@ export declare function run(argv: readonly string[], { log, err, cwd, now, check
|
|
|
283
282
|
checkReferences?: CheckReferences;
|
|
284
283
|
/** The skills report `lint`'s stderr line reads; a test hands a fixed one. */
|
|
285
284
|
skillLinks?: (root: string) => LinkReport;
|
|
285
|
+
onLintResults?: LintResults;
|
|
286
286
|
}): Promise<number>;
|
|
287
|
-
/**
|
|
288
|
-
* Findings on one file, printed by the formatter `paperlint lint` prints with — what `paperlint
|
|
289
|
-
* submission` shows of the venue rules before a send, so the two read the same.
|
|
290
|
-
*/
|
|
291
|
-
export declare function lintText(file: string, messages: readonly VenueMessage[]): Promise<string>;
|
|
292
287
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAiB7C,OAAO,EAAE,MAAM,EAAE,MAAM,+CAA+C,CAAC;AAEvE,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","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OAAO,CAAC,OAAO,CAAC,CAAC;IACzC;;;OAGG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,8EAA8E;IAC9E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,CAAC;IAC1C,aAAa,CAAC,EAAE,WAAW,CAAC;CACxB,GACL,OAAO,CAAC,MAAM,CAAC,CA2JjB"}
|
package/dist/cli.js
CHANGED
|
@@ -40,7 +40,7 @@ export { isMain };
|
|
|
40
40
|
import { checkStructure, formatStructure, asEslintResults, } from "./structure.js";
|
|
41
41
|
import { buildPapers, papersIn, anyFailed, remedyFor, MAIN } from "./build.js";
|
|
42
42
|
import { FRAGMENT_FILES, includeBlocks, paperBodies, } from "./paper-includes.js";
|
|
43
|
-
import { hasAtLeast
|
|
43
|
+
import { hasAtLeast } from "remeda";
|
|
44
44
|
import { refusalOf } from "./unowned-file.js";
|
|
45
45
|
import { ruleTimes, timingLines } from "./lint-timing.js";
|
|
46
46
|
import { prepareEngine } from "./build-engine.js";
|
|
@@ -72,7 +72,9 @@ import { BIB_RULE_LEVELS, bibRules } from "./bib-rules.js";
|
|
|
72
72
|
import { bibliographyReader } from "./references.js";
|
|
73
73
|
import { onlineReferences } from "./adapters/references/index.js";
|
|
74
74
|
import { hotcrpSite } from "./adapters/hotcrp/index.js";
|
|
75
|
-
import { runSubmission } from "./submission.js";
|
|
75
|
+
import { runSubmission, submissionSections } from "./submission.js";
|
|
76
|
+
import { LINT_FORMAT, isEmptyLintSet, lintExitCode, lintResultFor, lintText, printLintResults, submissionLinter, } from "./adapters/eslint/index.js";
|
|
77
|
+
export { lintText } from "./adapters/eslint/index.js";
|
|
76
78
|
import { ANY_PAPER, narrowToOwners, ownedPatterns, paperFiles, papersScope, ruleOwners, scopeToOwned, } from "./paper-files.js";
|
|
77
79
|
import { paperPreset, settingsProblemLine, presetProblemText, resolvePreset, resolveShipped, bareSeriesText, shippedPresets, shippedSpec, shippedFolderNames, SHIPPED_PREFIX, } from "./presets.js";
|
|
78
80
|
import { mergeRequirements, declaredUnion, requirementsFor, NO_REQUIREMENTS, } from "./tex-requirements.js";
|
|
@@ -106,7 +108,7 @@ import { FOLDER_LAYOUT_RULE_LEVELS, folderLayoutRules, } from "./folder-layout-r
|
|
|
106
108
|
import { folderLayoutHook } from "./folder-layout-hook.js";
|
|
107
109
|
import { paperFolderOf, writtenPath } from "./domain/paper-folder.js";
|
|
108
110
|
import { papersReached } from "./domain/paper-dirs.js";
|
|
109
|
-
import { NOTICE_HOOKS, collector, lintLine, mergeNotice, noticeText, notYetTold, recordTold, } from "./hooks-notice.js";
|
|
111
|
+
import { NOTICE_HOOKS, collector, lintLine, mergeNotice, noticeText, notYetTold, recordTold, hookNotRunningText, } from "./hooks-notice.js";
|
|
110
112
|
import { unwiredHooks } from "./hooks-settings.js";
|
|
111
113
|
import { linkSkills, locatePackage, unlinkedSkills, } from "./link-skills.js";
|
|
112
114
|
import { projectInstall } from "./adapters/package-manager/index.js";
|
|
@@ -159,7 +161,7 @@ const USAGE = `paperlint — machine-checkable gates for a paper kept in git
|
|
|
159
161
|
into ~/.cache/paperlint/texlive (PAPERLINT_TEXLIVE_DIR overrides); a second
|
|
160
162
|
run does nothing. --check: report what is missing, change nothing
|
|
161
163
|
npx paperlint doctor say what is actually wired — and what only LOOKS wired
|
|
162
|
-
npx paperlint submission new [paper] [--abstract <file>] [--save]
|
|
164
|
+
npx paperlint submission new [paper] [--abstract <file>] [--save] [--allow-lint-errors <reason>]
|
|
163
165
|
create the paper's submission on the venue's portal: the title
|
|
164
166
|
and abstract from the build, the authors from paperlint.json,
|
|
165
167
|
the PDF. A DRY RUN unless --save; a save records the new id in
|
|
@@ -170,6 +172,7 @@ const USAGE = `paperlint — machine-checkable gates for a paper kept in git
|
|
|
170
172
|
whether it is the local paper.pdf (sha256); flags a title,
|
|
171
173
|
abstract or authors that are not the paper's
|
|
172
174
|
npx paperlint submission update [paper] [--pdf <file>] [--abstract <file>] [--submit] [--save]
|
|
175
|
+
[--allow-lint-errors <reason>]
|
|
173
176
|
send the PDF (default: the paper's own), the paper's title
|
|
174
177
|
and abstract each when the portal holds another (--abstract:
|
|
175
178
|
that file's text instead), or "submitted". A DRY RUN unless --save: the portal checks the
|
|
@@ -260,6 +263,7 @@ submission:
|
|
|
260
263
|
--pdf <file> the PDF to compare (show) or send (update) instead of the paper's own
|
|
261
264
|
--abstract <file> new, update: a plain-text file whose text is sent as the abstract
|
|
262
265
|
--submit update: mark the submission submitted
|
|
266
|
+
--allow-lint-errors <reason> permit reported lint errors on a submission --save
|
|
263
267
|
--save new, update: really create or change the submission. Without it, nothing
|
|
264
268
|
is saved
|
|
265
269
|
|
|
@@ -1035,6 +1039,7 @@ const STRING_FLAGS = new Map([
|
|
|
1035
1039
|
["--kind", "kind"],
|
|
1036
1040
|
["--pdf", "pdf"],
|
|
1037
1041
|
["--abstract", "abstract"],
|
|
1042
|
+
["--allow-lint-errors", "allowLintErrors"],
|
|
1038
1043
|
["--url", "url"],
|
|
1039
1044
|
["--host", "host"],
|
|
1040
1045
|
["--to", "to"],
|
|
@@ -1144,15 +1149,19 @@ const IN_PROCESS_HOOKS = {
|
|
|
1144
1149
|
shellLeaves: leafCommandsNormalized,
|
|
1145
1150
|
readSend: submissionSend,
|
|
1146
1151
|
readUpload: uploadSend,
|
|
1152
|
+
lintPaper: lintSubmissionPaper,
|
|
1147
1153
|
});
|
|
1148
1154
|
}
|
|
1149
1155
|
catch {
|
|
1150
1156
|
return UNREADABLE_INPUT;
|
|
1151
1157
|
}
|
|
1152
1158
|
})();
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1159
|
+
const write = (result) => {
|
|
1160
|
+
if (result !== null)
|
|
1161
|
+
out(`${JSON.stringify(result)}\n`);
|
|
1162
|
+
return 0;
|
|
1163
|
+
};
|
|
1164
|
+
return said instanceof Promise ? said.then(write) : write(said);
|
|
1156
1165
|
},
|
|
1157
1166
|
};
|
|
1158
1167
|
/**
|
|
@@ -1166,8 +1175,35 @@ export function submissionSend(words) {
|
|
|
1166
1175
|
const clean = a.missingValue === undefined &&
|
|
1167
1176
|
a.unknownFlag === undefined &&
|
|
1168
1177
|
a.paths.length <= 2;
|
|
1169
|
-
return clean
|
|
1178
|
+
return clean
|
|
1179
|
+
? {
|
|
1180
|
+
paper: a.paths[1] ?? null,
|
|
1181
|
+
pdf: a.pdf,
|
|
1182
|
+
action: a.paths[0] === "new" ? "create" : a.submit ? "submit" : "update",
|
|
1183
|
+
allowLintErrors: a.allowLintErrors?.trim(),
|
|
1184
|
+
}
|
|
1185
|
+
: null;
|
|
1170
1186
|
}
|
|
1187
|
+
const lintSubmissionPaper = submissionLinter(async (paperDir, cwd, accept) => {
|
|
1188
|
+
const stderr = collector();
|
|
1189
|
+
await run(["lint", paperDir], {
|
|
1190
|
+
cwd,
|
|
1191
|
+
log: () => { },
|
|
1192
|
+
err: (line) => {
|
|
1193
|
+
stderr.write(`${line}\n`);
|
|
1194
|
+
},
|
|
1195
|
+
onLintResults: (results, structure) => {
|
|
1196
|
+
accept([
|
|
1197
|
+
...asEslintResults(structure).map((r) => ({
|
|
1198
|
+
...r,
|
|
1199
|
+
filePath: resolve(cwd, r.filePath),
|
|
1200
|
+
})),
|
|
1201
|
+
...results,
|
|
1202
|
+
]);
|
|
1203
|
+
},
|
|
1204
|
+
});
|
|
1205
|
+
return firstLine(stderr.text());
|
|
1206
|
+
}, (paperDir) => submissionSections(paperDir, { ...RECORD_DEPS, latex: latexReader }));
|
|
1171
1207
|
/**
|
|
1172
1208
|
* The words after `artifact`, read by this CLI's own parser, for an upload: the file it uploads, the
|
|
1173
1209
|
* paper (null for the current folder), and the host and project it goes to — or null when they would
|
|
@@ -1350,17 +1386,13 @@ function runHookPlain(name, { err = console.error, run = spawnHook,
|
|
|
1350
1386
|
// resolve the root entry ("." → dist/test.js), take its directory and put `cli.js` next to it —
|
|
1351
1387
|
// the very file the package itself declares as its `bin`.
|
|
1352
1388
|
resolve = (spec) => createRequire(import.meta.url).resolve(spec), stdin = defaultStdin, out = defaultOut, feed, capture = false, } = {}) {
|
|
1353
|
-
|
|
1354
|
-
err(`\`hook\` needs a name, e.g. \`paperlint hook paper-edit-guard\``);
|
|
1355
|
-
return 2;
|
|
1356
|
-
}
|
|
1357
|
-
const inProcess = IN_PROCESS_HOOKS[name];
|
|
1389
|
+
const inProcess = IN_PROCESS_HOOKS[name ?? ""];
|
|
1358
1390
|
if (inProcess !== undefined)
|
|
1359
1391
|
return inProcess({ err, stdin, out });
|
|
1360
|
-
const program = fileURLToPath(new URL(`../hooks/${name}.hook.mjs`, import.meta.url));
|
|
1361
|
-
if (!existsSync(program)) {
|
|
1362
|
-
err(
|
|
1363
|
-
return 2;
|
|
1392
|
+
const program = fileURLToPath(new URL(`../hooks/${name ?? ""}.hook.mjs`, import.meta.url));
|
|
1393
|
+
if (!name || !existsSync(program)) {
|
|
1394
|
+
err(hookNotRunningText(name, program, packageVersion()));
|
|
1395
|
+
return 1; // not 2: that denies every Bash command, the fix included (#324); not 0: nobody sees it
|
|
1364
1396
|
}
|
|
1365
1397
|
let runtime;
|
|
1366
1398
|
try {
|
|
@@ -1372,7 +1404,7 @@ resolve = (spec) => createRequire(import.meta.url).resolve(spec), stdin = defaul
|
|
|
1372
1404
|
err(`paperlint: the hook runtime (vigiles) is not resolvable from ${fileURLToPath(new URL(".", import.meta.url))}.\n` +
|
|
1373
1405
|
`The \`${name}\` hook is NOT running. Everything else — \`paperlint lint\`, CI — is unaffected.\n` +
|
|
1374
1406
|
`Reinstall this package so its dependencies are present.`);
|
|
1375
|
-
return 0
|
|
1407
|
+
return 1; // not 2: that would deny every Bash command; not 0: nobody would see this
|
|
1376
1408
|
}
|
|
1377
1409
|
const args = [runtime, "hook-runtime", "run-program", program];
|
|
1378
1410
|
const r = feed === undefined
|
|
@@ -1720,6 +1752,7 @@ const SIMPLE = {
|
|
|
1720
1752
|
abstract: a.abstract,
|
|
1721
1753
|
submit: a.submit,
|
|
1722
1754
|
save: a.save,
|
|
1755
|
+
allowLintErrors: a.allowLintErrors ?? undefined,
|
|
1723
1756
|
}, {
|
|
1724
1757
|
files: nodeFiles,
|
|
1725
1758
|
presets: PRESET_DEPS,
|
|
@@ -1729,6 +1762,7 @@ const SIMPLE = {
|
|
|
1729
1762
|
latex: latexReader,
|
|
1730
1763
|
codec: sourcesCodec,
|
|
1731
1764
|
lintText,
|
|
1765
|
+
lintPaper: lintSubmissionPaper,
|
|
1732
1766
|
yaml: parseYaml,
|
|
1733
1767
|
now: isoNow,
|
|
1734
1768
|
log,
|
|
@@ -1866,21 +1900,22 @@ const selfInstallDeps = (install) => {
|
|
|
1866
1900
|
};
|
|
1867
1901
|
/** The LaTeX language, loaded when a lint needs it: only `lint` and the `lint-edited` hook do. */
|
|
1868
1902
|
const loadLatexLanguage = async () => (await import("#eslint-rules/latex-language")).texLanguage;
|
|
1869
|
-
|
|
1903
|
+
/** A missing flag value must be reported before falling back to any default. */
|
|
1904
|
+
function argumentProblem(a) {
|
|
1905
|
+
if (a.missingValue)
|
|
1906
|
+
return (`${a.missingValue} needs a value — it was given none.\n` +
|
|
1907
|
+
`Without it the run would silently fall back to whatever config it discovers, which is not what the command line said.`);
|
|
1908
|
+
if (a.unknownFlag !== undefined)
|
|
1909
|
+
return `unknown flag \`${a.unknownFlag}\` — \`paperlint --help\` lists every flag`;
|
|
1910
|
+
return !a.help && a.cmd && a.cmd !== "submission" && a.allowLintErrors != null
|
|
1911
|
+
? "--allow-lint-errors is only for submission new or update with --save"
|
|
1912
|
+
: null;
|
|
1913
|
+
}
|
|
1914
|
+
export async function run(argv, { log = console.log, err = console.error, cwd = process.cwd(), now = () => performance.now(), checkReferences = onlineReferences, loadTexLanguage = loadLatexLanguage, skillLinks = readSkillLinks, install = projectInstall, claude = claudeCode(), onLintResults, } = {}) {
|
|
1870
1915
|
const a = parseArgs(argv);
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
if (a.missingValue) {
|
|
1875
|
-
err(`${a.missingValue} needs a value — it was given none.\n` +
|
|
1876
|
-
`Without it the run would silently fall back to whatever config it discovers, which is ` +
|
|
1877
|
-
`not what the command line said.`);
|
|
1878
|
-
return 2;
|
|
1879
|
-
}
|
|
1880
|
-
if (a.unknownFlag !== undefined) {
|
|
1881
|
-
err(`unknown flag \`${a.unknownFlag}\` — \`paperlint --help\` lists every flag`);
|
|
1882
|
-
return 2;
|
|
1883
|
-
}
|
|
1916
|
+
const problem = argumentProblem(a);
|
|
1917
|
+
if (problem !== null)
|
|
1918
|
+
return (err(problem), 2);
|
|
1884
1919
|
if (a.help || !a.cmd) {
|
|
1885
1920
|
log(USAGE);
|
|
1886
1921
|
return a.help ? 0 : 2;
|
|
@@ -1976,7 +2011,7 @@ export async function run(argv, { log = console.log, err = console.error, cwd =
|
|
|
1976
2011
|
results = await eslint.lintFiles(paths);
|
|
1977
2012
|
}
|
|
1978
2013
|
catch (e) {
|
|
1979
|
-
if (
|
|
2014
|
+
if (isEmptyLintSet(e))
|
|
1980
2015
|
results = [];
|
|
1981
2016
|
else
|
|
1982
2017
|
throw e;
|
|
@@ -2004,6 +2039,7 @@ export async function run(argv, { log = console.log, err = console.error, cwd =
|
|
|
2004
2039
|
.map((d) => join(d, MAIN))
|
|
2005
2040
|
.filter((f) => existsSync(f)),
|
|
2006
2041
|
bodies,
|
|
2042
|
+
onLintResults,
|
|
2007
2043
|
});
|
|
2008
2044
|
hooksLine(root, err, skillLinks, claude);
|
|
2009
2045
|
// On stderr, so `--json` leaves stdout a clean array.
|
|
@@ -2091,25 +2127,7 @@ const editLinter = (loadTexLanguage) => async (dir) => {
|
|
|
2091
2127
|
};
|
|
2092
2128
|
};
|
|
2093
2129
|
/** A result of the hook's new errors, with the counts the formatter prints recomputed. */
|
|
2094
|
-
const counted = (r) => ({
|
|
2095
|
-
filePath: r.filePath,
|
|
2096
|
-
// Only errors reach the formatter: the hook reports nothing else.
|
|
2097
|
-
messages: r.messages.map((m) => ({
|
|
2098
|
-
ruleId: m.ruleId,
|
|
2099
|
-
message: m.message,
|
|
2100
|
-
line: m.line,
|
|
2101
|
-
column: m.column,
|
|
2102
|
-
endLine: m.endLine,
|
|
2103
|
-
severity: 2,
|
|
2104
|
-
})),
|
|
2105
|
-
suppressedMessages: [],
|
|
2106
|
-
errorCount: r.messages.length,
|
|
2107
|
-
fatalErrorCount: 0,
|
|
2108
|
-
warningCount: 0,
|
|
2109
|
-
fixableErrorCount: 0,
|
|
2110
|
-
fixableWarningCount: 0,
|
|
2111
|
-
usedDeprecatedRules: [],
|
|
2112
|
-
});
|
|
2130
|
+
const counted = (r) => lintResultFor(r.filePath, r.messages.map((m) => ({ ...m, severity: 2 })));
|
|
2113
2131
|
/**
|
|
2114
2132
|
* The first path that is a FILE paperlint does not lint, or null. ESLint would answer such a file
|
|
2115
2133
|
* with a warning result ("File ignored because of a matching ignore pattern"), which counts as a
|
|
@@ -2124,91 +2142,32 @@ async function firstUnownedFile(eslint, paths) {
|
|
|
2124
2142
|
return p;
|
|
2125
2143
|
return null;
|
|
2126
2144
|
}
|
|
2127
|
-
/**
|
|
2128
|
-
* ESLint's refusals of an empty set: nothing matched (`file-not-found`), or everything that matched
|
|
2129
|
-
* is outside paperlint's scope (`all-matched-files-ignored` — a papers directory holding only
|
|
2130
|
-
* vendored scripts). Both mean "nothing was linted", which the caller reports itself.
|
|
2131
|
-
*/
|
|
2132
|
-
/** What a thrown ESLint error says about itself; anything else thrown says nothing. */
|
|
2133
|
-
const EslintFailure = z
|
|
2134
|
-
.object({
|
|
2135
|
-
messageTemplate: z.string().optional(),
|
|
2136
|
-
message: z.string().optional(),
|
|
2137
|
-
})
|
|
2138
|
-
.catch({});
|
|
2139
|
-
const isEmptySet = (e) => {
|
|
2140
|
-
const fail = EslintFailure.parse(e);
|
|
2141
|
-
return (fail.messageTemplate === "file-not-found" ||
|
|
2142
|
-
fail.messageTemplate === "all-matched-files-ignored" ||
|
|
2143
|
-
/No files matching/i.test(String(fail.message)));
|
|
2144
|
-
};
|
|
2145
|
-
/**
|
|
2146
|
-
* Findings on one file, printed by the formatter `paperlint lint` prints with — what `paperlint
|
|
2147
|
-
* submission` shows of the venue rules before a send, so the two read the same.
|
|
2148
|
-
*/
|
|
2149
|
-
export async function lintText(file, messages) {
|
|
2150
|
-
const errorCount = messages.filter((m) => m.severity === 2).length;
|
|
2151
|
-
const result = {
|
|
2152
|
-
filePath: file,
|
|
2153
|
-
messages: [...messages],
|
|
2154
|
-
suppressedMessages: [],
|
|
2155
|
-
errorCount,
|
|
2156
|
-
fatalErrorCount: 0,
|
|
2157
|
-
warningCount: messages.length - errorCount,
|
|
2158
|
-
fixableErrorCount: 0,
|
|
2159
|
-
fixableWarningCount: 0,
|
|
2160
|
-
usedDeprecatedRules: [],
|
|
2161
|
-
};
|
|
2162
|
-
return (await new ESLint().loadFormatter(LINT_FORMAT)).format([result]);
|
|
2163
|
-
}
|
|
2164
|
-
/** The formatter `paperlint lint` prints with. */
|
|
2165
|
-
const LINT_FORMAT = "stylish";
|
|
2166
2145
|
/** Printed under a clean `lint`, the README's disclaimer in one line. */
|
|
2167
2146
|
const CLEAN_RUN_REMINDER = "Check the venue's own call before you submit: a call can change between editions, and a check can miss a case.";
|
|
2168
2147
|
/**
|
|
2169
2148
|
* The end of `paperlint lint`: refuse an optional rule that reached no paper, print the findings, and
|
|
2170
2149
|
* decide the exit code. Pulled out of `run` so each question has its own function.
|
|
2171
2150
|
*/
|
|
2172
|
-
async function reportLint(eslint, results, structure, { a, log, err, where, opts, projectPapers, bodies, }) {
|
|
2151
|
+
async function reportLint(eslint, results, structure, { a, log, err, where, opts, projectPapers, bodies, onLintResults, }) {
|
|
2173
2152
|
const silent = await silentOptionalRules(eslint, [...results.map((r) => r.filePath), ...projectPapers], opts, bodyFilesOf(bodies));
|
|
2174
2153
|
if (silent.length > 0) {
|
|
2175
2154
|
err(`${silent.join(", ")} is turned on in "rules", but no paper.tex of the project gets it — check the block's ` +
|
|
2176
2155
|
`"files" (relative to ${where}). A rule that never runs reports exactly like a rule that passed.`);
|
|
2177
2156
|
return 1;
|
|
2178
2157
|
}
|
|
2179
|
-
if (
|
|
2180
|
-
|
|
2181
|
-
...asEslintResults(structure),
|
|
2182
|
-
...results.map((r) => omit(r, ["stats"])),
|
|
2183
|
-
], null, 1));
|
|
2158
|
+
if (onLintResults !== undefined)
|
|
2159
|
+
onLintResults(results, structure);
|
|
2184
2160
|
else {
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
log(out.trim() ||
|
|
2192
|
-
(clean
|
|
2193
|
-
? `✓ ${String(results.length)} file(s) checked, no findings`
|
|
2194
|
-
: ""));
|
|
2195
|
-
// A clean run is the one result a reader could take as a guarantee, so it, and only it,
|
|
2196
|
-
// carries the README's reminder. Findings speak for themselves; --json is for machines.
|
|
2161
|
+
const clean = await printLintResults(eslint, results, {
|
|
2162
|
+
json: a.json,
|
|
2163
|
+
structure: asEslintResults(structure),
|
|
2164
|
+
structureText: formatStructure(structure),
|
|
2165
|
+
log,
|
|
2166
|
+
});
|
|
2197
2167
|
if (clean)
|
|
2198
2168
|
log(` ${CLEAN_RUN_REMINDER}`);
|
|
2199
2169
|
}
|
|
2200
|
-
|
|
2201
|
-
return 1;
|
|
2202
|
-
// Warnings fail the run only when the threshold is named EXPLICITLY. A negative threshold means
|
|
2203
|
-
// "do not count them at all", and that is the default.
|
|
2204
|
-
if (a.maxWarnings >= 0) {
|
|
2205
|
-
const warnings = results.reduce((n, r) => n + r.warningCount, 0);
|
|
2206
|
-
if (warnings > a.maxWarnings) {
|
|
2207
|
-
err(`${String(warnings)} warning(s) exceed the --max-warnings limit of ${String(a.maxWarnings)}`);
|
|
2208
|
-
return 1;
|
|
2209
|
-
}
|
|
2210
|
-
}
|
|
2211
|
-
return 0;
|
|
2170
|
+
return lintExitCode(results, structure.length > 0, a.maxWarnings, err);
|
|
2212
2171
|
}
|
|
2213
2172
|
// 🔴 `isMain`, NOT A STRING COMPARISON. The first version wrote
|
|
2214
2173
|
// if (import.meta.url === `file://${process.argv[1]}`)
|