paperlint 4.0.0 → 4.2.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/.github/workflows/ci.yml +16 -23
- package/CLAUDE.md +55 -11
- package/CONTRIBUTING.md +30 -7
- package/README.md +11 -8
- package/dist/adapters/banal/invocation.d.ts +1 -1
- package/dist/adapters/latex/document-class.d.ts +23 -0
- package/dist/adapters/latex/document-class.d.ts.map +1 -0
- package/dist/adapters/latex/document-class.js +110 -0
- package/dist/adapters/latex/document-class.js.map +1 -0
- package/dist/adapters/latex/hidden.d.ts +16 -0
- package/dist/adapters/latex/hidden.d.ts.map +1 -0
- package/dist/adapters/latex/hidden.js +49 -0
- package/dist/adapters/latex/hidden.js.map +1 -0
- package/dist/adapters/latex/includes.d.ts +12 -0
- package/dist/adapters/latex/includes.d.ts.map +1 -0
- package/dist/adapters/latex/includes.js +42 -0
- package/dist/adapters/latex/includes.js.map +1 -0
- package/dist/adapters/latex/index.d.ts +33 -0
- package/dist/adapters/latex/index.d.ts.map +1 -0
- package/dist/adapters/latex/index.js +25 -0
- package/dist/adapters/latex/index.js.map +1 -0
- package/dist/adapters/latex/nodes.d.ts +58 -0
- package/dist/adapters/latex/nodes.d.ts.map +1 -0
- package/dist/adapters/latex/nodes.js +97 -0
- package/dist/adapters/latex/nodes.js.map +1 -0
- package/dist/adapters/latex/outline.d.ts +10 -0
- package/dist/adapters/latex/outline.d.ts.map +1 -0
- package/dist/adapters/latex/outline.js +39 -0
- package/dist/adapters/latex/outline.js.map +1 -0
- package/dist/adapters/latex/parse.d.ts +42 -0
- package/dist/adapters/latex/parse.d.ts.map +1 -0
- package/dist/adapters/latex/parse.js +95 -0
- package/dist/adapters/latex/parse.js.map +1 -0
- package/dist/adapters/latex/prose.d.ts +8 -0
- package/dist/adapters/latex/prose.d.ts.map +1 -0
- package/dist/adapters/latex/prose.js +353 -0
- package/dist/adapters/latex/prose.js.map +1 -0
- package/dist/adapters/latex/rendered.d.ts +10 -0
- package/dist/adapters/latex/rendered.d.ts.map +1 -0
- package/dist/adapters/latex/rendered.js +39 -0
- package/dist/adapters/latex/rendered.js.map +1 -0
- package/dist/adapters/pdfjs/fill.d.ts.map +1 -1
- package/dist/adapters/pdfjs/fill.js +12 -12
- package/dist/adapters/pdfjs/fill.js.map +1 -1
- package/dist/build.js +4 -4
- package/dist/build.js.map +1 -1
- package/dist/claim-provenance.d.ts +34 -0
- package/dist/claim-provenance.d.ts.map +1 -0
- package/dist/claim-provenance.js +146 -0
- package/dist/claim-provenance.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +49 -5
- package/dist/cli.js.map +1 -1
- package/dist/domain/paper-source.d.ts +58 -0
- package/dist/domain/paper-source.d.ts.map +1 -0
- package/dist/domain/paper-source.js +109 -0
- package/dist/domain/paper-source.js.map +1 -0
- package/dist/domain/sentences.d.ts +26 -0
- package/dist/domain/sentences.d.ts.map +1 -0
- package/dist/domain/sentences.js +48 -0
- package/dist/domain/sentences.js.map +1 -0
- package/dist/domain/tex-document.d.ts +119 -0
- package/dist/domain/tex-document.d.ts.map +1 -0
- package/dist/domain/tex-document.js +43 -0
- package/dist/domain/tex-document.js.map +1 -0
- package/dist/eslint-rules/paper-typography.d.ts +7 -0
- package/dist/eslint-rules/paper-typography.d.ts.map +1 -1
- package/dist/eslint-rules/paper-typography.js +53 -1
- package/dist/eslint-rules/paper-typography.js.map +1 -1
- package/dist/facts-file.d.ts.map +1 -1
- package/dist/facts-file.js +2 -2
- package/dist/facts-file.js.map +1 -1
- package/dist/new-paper.d.ts +5 -0
- package/dist/new-paper.d.ts.map +1 -1
- package/dist/new-paper.js +3 -0
- package/dist/new-paper.js.map +1 -1
- package/dist/package-dirs.d.ts +5 -0
- package/dist/package-dirs.d.ts.map +1 -0
- package/dist/package-dirs.js +14 -0
- package/dist/package-dirs.js.map +1 -0
- package/dist/ports/latex.d.ts +35 -0
- package/dist/ports/latex.d.ts.map +1 -0
- package/dist/ports/latex.js +2 -0
- package/dist/ports/latex.js.map +1 -0
- package/dist/presets.d.ts +15 -2
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +19 -6
- package/dist/presets.js.map +1 -1
- package/dist/register.d.ts +40 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +134 -0
- package/dist/register.js.map +1 -0
- package/dist/tex-paper.d.ts +19 -0
- package/dist/tex-paper.d.ts.map +1 -0
- package/dist/tex-paper.js +105 -0
- package/dist/tex-paper.js.map +1 -0
- package/dist/tex-requirements.d.ts +11 -0
- package/dist/tex-requirements.d.ts.map +1 -1
- package/dist/tex-requirements.js +14 -8
- package/dist/tex-requirements.js.map +1 -1
- package/dist/tex-venue-rules.d.ts +88 -0
- package/dist/tex-venue-rules.d.ts.map +1 -0
- package/dist/tex-venue-rules.js +268 -0
- package/dist/tex-venue-rules.js.map +1 -0
- package/dist/venue-rules.d.ts +1 -1
- package/dist/venue-rules.d.ts.map +1 -1
- package/docs/configuration.md +3 -2
- package/docs/e2e.md +69 -40
- package/docs/install.md +1 -1
- package/docs/prior-art/README.md +1 -1
- package/docs/prior-art/package-location.md +5 -5
- package/docs/prior-art/repro/README.md +1 -1
- package/docs/prior-art/test-tooling.md +21 -10
- package/docs/rules/tex/claim-provenance.md +83 -0
- package/docs/rules/tex/missing-input.md +58 -0
- package/docs/rules/tex/register.md +77 -0
- package/docs/rules/tex/required-section.md +75 -0
- package/docs/rules/tex/template.md +74 -0
- package/docs/rules/tex/venue-leftover.md +73 -0
- package/docs/rules.md +73 -48
- package/docs/testing.md +17 -4
- package/docs/texlive-install-decision.md +1 -1
- package/docs/toolchain.md +2 -2
- package/eslint-rules/paper-typography.test.mjs +48 -1
- package/eslint-rules/paper-typography.ts +72 -1
- package/eslint.config.mjs +156 -15
- package/fixtures/build-e2e/acmart/expect.json +26 -0
- package/fixtures/build-e2e/aidc/PIPELINE-STATUS.md +3 -0
- package/fixtures/build-e2e/aidc/expect.json +14 -0
- package/fixtures/build-e2e/aidc/paper.tex +46 -0
- package/fixtures/build-e2e/aidc/paperlint.json +1 -0
- package/fixtures/build-e2e/broken/expect.json +11 -0
- package/fixtures/build-e2e/cite/expect.json +27 -0
- package/fixtures/build-e2e/empty/expect.json +12 -0
- package/fixtures/build-e2e/fallback/expect.json +53 -0
- package/fixtures/build-e2e/guards/expect.json +6 -0
- package/fixtures/build-e2e/no-source/expect.json +10 -0
- package/fixtures/build-e2e/unbalanced/expect.json +60 -0
- package/fixtures/pdf-facts/README.md +1 -1
- package/fixtures/real-markdown-paper/baseline.ts +8 -7
- package/fixtures/render-paper/build-clean.sh +3 -5
- package/package.json +14 -2
- package/{skills/submit-paper/references/venues → presets}/acm-sigconf.jsonc +4 -1
- package/{skills/submit-paper/references/venues → presets}/agenticdev.jsonc +4 -0
- package/presets/aidc.jsonc +73 -0
- package/{skills/submit-paper/references/venues → presets}/aisec.jsonc +4 -0
- package/presets/ieee-conference.jsonc +66 -0
- package/{skills/submit-paper/references/venues → presets}/realm.jsonc +8 -1
- package/{skills/submit-paper/references/venues → presets/tex}/paper-guards.tex +1 -1
- package/{skills/submit-paper/references/venues → presets}/venue-profile.schema.json +30 -2
- package/scripts/check.harness.ts +64 -10
- package/scripts/check.test.ts +60 -13
- package/scripts/check.ts +83 -30
- package/scripts/test.test.ts +1 -1
- package/scripts/test.ts +1 -1
- package/skills/cold-read-diff/SKILL.md +31 -10
- package/skills/cold-read-diff/SKILL.md.spec.ts +30 -9
- package/skills/draft-paper/SKILL.md +2 -2
- package/skills/draft-paper/SKILL.md.spec.ts +1 -1
- package/skills/grade-paper-writing/SKILL.md +109 -44
- package/skills/grade-paper-writing/SKILL.md.spec.ts +108 -43
- package/skills/harden-paper/SKILL.md +35 -36
- package/skills/harden-paper/SKILL.md.spec.ts +34 -35
- package/skills/paper-adversarial-review/SKILL.md +2 -2
- package/skills/paper-adversarial-review/SKILL.md.spec.ts +1 -1
- package/skills/paper-pipeline/PIPELINE-MAP.md +2 -2
- package/skills/paper-pipeline/SKILL.md +4 -4
- package/skills/paper-pipeline/SKILL.md.spec.ts +3 -3
- package/skills/paper-pipeline/grade-paper-writing-ablation.eval.mjs +6 -6
- package/skills/paper-pipeline/references/writing-craft.md +53 -18
- package/skills/paper-pipeline/scripts/consumer.d.mts +0 -2
- package/skills/paper-pipeline/scripts/consumer.mjs +1 -15
- package/skills/pc-panel-review/SKILL.md +36 -11
- package/skills/pc-panel-review/SKILL.md.spec.ts +35 -10
- package/skills/render-paper/SKILL.md +2 -2
- package/skills/render-paper/SKILL.md.spec.ts +1 -1
- package/skills/render-paper/check-render.sh +16 -63
- package/skills/render-paper/render-paper.harness.mjs +17 -59
- package/src/adapters/banal/index.test.ts +1 -1
- package/src/adapters/banal/invocation.ts +1 -1
- package/src/adapters/banal/output.test.ts +1 -1
- package/src/adapters/banal/run.test.ts +1 -1
- package/src/adapters/banal/xml.test.ts +1 -1
- package/src/adapters/latex/document-class.ts +155 -0
- package/src/adapters/latex/hidden.ts +70 -0
- package/src/adapters/latex/includes.ts +66 -0
- package/src/adapters/latex/index.test.ts +535 -0
- package/src/adapters/latex/index.ts +65 -0
- package/src/adapters/latex/nodes.ts +150 -0
- package/src/adapters/latex/outline.ts +64 -0
- package/src/adapters/latex/parse.ts +137 -0
- package/src/adapters/latex/prose.ts +484 -0
- package/src/adapters/latex/rendered.ts +59 -0
- package/src/adapters/pdfjs/fill.test.ts +1 -1
- package/src/adapters/pdfjs/fill.ts +18 -10
- package/src/build.harness.mjs +5 -7
- package/src/build.ts +4 -4
- package/src/claim-provenance.test.ts +352 -0
- package/src/claim-provenance.ts +217 -0
- package/src/cli.harness.mjs +1 -1
- package/src/cli.test.ts +2 -8
- package/src/cli.ts +53 -8
- package/src/domain/paper-source.test.ts +156 -0
- package/src/domain/paper-source.ts +233 -0
- package/src/domain/sentences.ts +67 -0
- package/src/domain/tex-document.test.ts +80 -0
- package/src/domain/tex-document.ts +143 -0
- package/src/engine.harness.mjs +1 -1
- package/src/facts-file.test.ts +4 -7
- package/src/facts-file.ts +2 -2
- package/src/latex-loop.harness.ts +1 -1
- package/src/new-paper.test.ts +28 -3
- package/src/new-paper.ts +8 -0
- package/src/package-dirs.ts +17 -0
- package/src/paper-settings-commands.test.ts +6 -1
- package/src/ports/latex.ts +42 -0
- package/src/presets.test.ts +65 -4
- package/src/presets.ts +38 -15
- package/src/register.test.ts +165 -0
- package/src/register.ts +177 -0
- package/src/rule-cases.test.ts +524 -0
- package/src/rule-docs.test.ts +159 -0
- package/src/tex-paper.test.ts +131 -0
- package/src/tex-paper.ts +152 -0
- package/src/tex-requirements.harness.ts +13 -23
- package/src/tex-requirements.ts +35 -8
- package/src/tex-venue-rules.test.ts +741 -0
- package/src/tex-venue-rules.ts +461 -0
- package/src/toolchain.harness.mjs +1 -1
- package/src/venue-rules.test.ts +96 -4
- package/src/venue-rules.ts +1 -1
- package/templates/paper/paper.tex +2 -1
- package/skills/harden-paper/fixtures/uncited-assertions-sample.md +0 -43
- package/skills/harden-paper/fixtures/uncited-assertions-sample.tex +0 -77
- /package/{skills/submit-paper/references/venues → presets/tex}/agenticdev.tex +0 -0
- /package/{skills/submit-paper/references/venues → presets}/tex-base.jsonc +0 -0
|
@@ -51,6 +51,12 @@ export interface VenueFormat {
|
|
|
51
51
|
}
|
|
52
52
|
/** Every format field a preset left out is null; a merge fills it from the parent. */
|
|
53
53
|
export declare const NO_FORMAT: VenueFormat;
|
|
54
|
+
/** A section a venue requires: its exact title, and whether it must close the paper. */
|
|
55
|
+
export interface RequiredSection {
|
|
56
|
+
readonly title: string;
|
|
57
|
+
/** "last": after every section of the body; null: anywhere. */
|
|
58
|
+
readonly position: "last" | null;
|
|
59
|
+
}
|
|
54
60
|
/**
|
|
55
61
|
* One preset FILE, parsed — before its `extends` chain is resolved (`src/presets.ts` does that).
|
|
56
62
|
* A preset is a venue or a template family: `{ extends?, name?, template?, format?, tex?, rules? }`.
|
|
@@ -60,7 +66,12 @@ export interface PresetFile {
|
|
|
60
66
|
readonly extends: string | null;
|
|
61
67
|
/** A display name for messages; the file name otherwise. */
|
|
62
68
|
readonly name: string | null;
|
|
69
|
+
/** The `\\documentclass` the venue's template uses, as the file spells it; null when it names none. */
|
|
63
70
|
readonly template: string | null;
|
|
71
|
+
/** Other names the venue goes by in a paper's text; empty when the file names none. */
|
|
72
|
+
readonly aliases: readonly string[];
|
|
73
|
+
/** Sections the venue requires; null when the file names none (a child's list replaces its parent's). */
|
|
74
|
+
readonly requiredSections: readonly RequiredSection[] | null;
|
|
64
75
|
/** Null when the file declares no `tex` block (allowed only with `extends`). */
|
|
65
76
|
readonly tex: TexRequirements | null;
|
|
66
77
|
readonly format: VenueFormat;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tex-requirements.d.ts","sourceRoot":"","sources":["../src/tex-requirements.ts"],"names":[],"mappings":"AA0BA,OAAO,GAAG,MAAM,KAAK,CAAC;AAKtB,gEAAgE;AAChE,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;AAExE,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;CAC/B;AAED,kGAAkG;AAClG,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAC;CAC/B;AAED,yFAAyF;AACzF,eAAO,MAAM,YAAY,mBAAmB,CAAC;AAC7C,eAAO,MAAM,WAAW,8BAA8B,CAAC;AAGvD,eAAO,MAAM,eAAe,EAAE,eAA6C,CAAC;AAE5E,gEAAgE;AAChE,KAAK,OAAO,GAAG,IAAI,CACjB,cAAc,YAAY,CAAC,EAC3B,2BAA2B,GAAG,8BAA8B,CAC7D,CAAC;AAMF,wGAAwG;AACxG,wBAAgB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AgB,YAAY,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,EAAE,CAI3D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAA;CAAE,GAAG,IAAI,EACxE,GAAG,GAAE,MAAqB,GACzB,iBAAiB,CAWnB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,GAAG,GAAE,MAAqB,EAC1B,KAAK,GAAE,SAAS,eAAe,EAAO,GACrC;IACD,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAUA"}
|
package/dist/tex-requirements.js
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
* `TexRequirements` and never looks at the text again; a malformed profile throws with the path
|
|
17
17
|
* of every violation, it is never read as "no packages".
|
|
18
18
|
*
|
|
19
|
-
* Where the profiles live is answered by `
|
|
20
|
-
* allowed to know where this package is installed (rule 10).
|
|
19
|
+
* Where the profiles live is answered by `presetsDir()` in `package-dirs.ts` — the one module
|
|
20
|
+
* allowed to know where this package's data is installed (rule 10).
|
|
21
21
|
*/
|
|
22
22
|
// eslint-disable-next-line boundaries/dependencies -- legacy I/O, moves behind a port in #76
|
|
23
23
|
import { readFileSync, readdirSync } from "node:fs";
|
|
@@ -25,7 +25,7 @@ import { createRequire } from "node:module";
|
|
|
25
25
|
import { join } from "node:path";
|
|
26
26
|
// eslint-disable-next-line boundaries/dependencies -- legacy layer, moves behind a port in #76
|
|
27
27
|
import Ajv from "ajv";
|
|
28
|
-
import {
|
|
28
|
+
import { presetsDir } from "./package-dirs.js";
|
|
29
29
|
import { CONFIG_FILE } from "#lib/paper-config";
|
|
30
30
|
import { fieldOf } from "./domain/record.js";
|
|
31
31
|
/** The profile every paper gets, and the only one a paper with an unknown venue gets. */
|
|
@@ -108,6 +108,10 @@ function formatOf(j = {}) {
|
|
|
108
108
|
kinds: kindsOf(j.kinds),
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
+
/** A preset's `required_sections`, or null when it names none. */
|
|
112
|
+
const sectionsOf = (r) => r === undefined
|
|
113
|
+
? null
|
|
114
|
+
: r.map((x) => ({ title: x.title, position: orNull(x.position) }));
|
|
111
115
|
/**
|
|
112
116
|
* The text of one preset file → the typed file, or an Error naming every problem. The ONE parser
|
|
113
117
|
* of a preset: the toolchain reads its `tex`, the venue rules its `format`, the config its `rules`.
|
|
@@ -116,7 +120,7 @@ function formatOf(j = {}) {
|
|
|
116
120
|
* @param file the name to put in messages
|
|
117
121
|
* @param dir the directory holding the schema (the shipped venues directory by default)
|
|
118
122
|
*/
|
|
119
|
-
export function parsePreset(text, file, dir =
|
|
123
|
+
export function parsePreset(text, file, dir = presetsDir()) {
|
|
120
124
|
const parsed = typescript().parseConfigFileTextToJson(file, text);
|
|
121
125
|
const config = parsed.config;
|
|
122
126
|
const error = parsed.error;
|
|
@@ -130,13 +134,15 @@ export function parsePreset(text, file, dir = packageVenuesDir()) {
|
|
|
130
134
|
extends: orNull(j.extends),
|
|
131
135
|
name: orNull(j.name),
|
|
132
136
|
template: orNull(j.template),
|
|
137
|
+
aliases: j.aliases ?? [],
|
|
138
|
+
requiredSections: sectionsOf(j.required_sections),
|
|
133
139
|
tex: j.tex ? { packages: j.tex.packages, tools: j.tex.tools ?? {} } : null,
|
|
134
140
|
format: formatOf(j.format),
|
|
135
141
|
rules: j.rules ?? {},
|
|
136
142
|
};
|
|
137
143
|
}
|
|
138
144
|
/** The text of one preset → the TeX requirements it declares itself (none without a `tex` block). */
|
|
139
|
-
export function parseProfile(text, file, dir =
|
|
145
|
+
export function parseProfile(text, file, dir = presetsDir()) {
|
|
140
146
|
return parsePreset(text, file, dir).tex ?? NO_REQUIREMENTS;
|
|
141
147
|
}
|
|
142
148
|
/**
|
|
@@ -154,7 +160,7 @@ function readProfile(dir, file) {
|
|
|
154
160
|
return parseProfile(readFileSync(join(dir, file), "utf8"), file, dir);
|
|
155
161
|
}
|
|
156
162
|
/** The venues that have a profile — every `.jsonc` in the directory except the base set. */
|
|
157
|
-
export function venueNames(dir =
|
|
163
|
+
export function venueNames(dir = presetsDir()) {
|
|
158
164
|
return readdirSync(dir)
|
|
159
165
|
.filter((f) => f.endsWith(PROFILE_EXT) && f !== BASE_PROFILE)
|
|
160
166
|
.map((f) => f.slice(0, -PROFILE_EXT.length))
|
|
@@ -184,7 +190,7 @@ export function packageNames(tex) {
|
|
|
184
190
|
* `extends` chain, resolved by `src/presets.ts`). A paper with no preset gets the base set, and the
|
|
185
191
|
* source says so, so an ACM paper built without a preset is visibly running on the base set.
|
|
186
192
|
*/
|
|
187
|
-
export function requirementsFor(preset, dir =
|
|
193
|
+
export function requirementsFor(preset, dir = presetsDir()) {
|
|
188
194
|
const base = readProfile(dir, BASE_PROFILE);
|
|
189
195
|
return preset === null
|
|
190
196
|
? {
|
|
@@ -201,7 +207,7 @@ export function requirementsFor(preset, dir = packageVenuesDir()) {
|
|
|
201
207
|
* papers, which may live outside the package. The set `paperlint toolchain` installs, so one tree
|
|
202
208
|
* builds any paper.
|
|
203
209
|
*/
|
|
204
|
-
export function declaredUnion(dir =
|
|
210
|
+
export function declaredUnion(dir = presetsDir(), extra = []) {
|
|
205
211
|
const venues = venueNames(dir);
|
|
206
212
|
const shipped = venues.reduce((acc, v) => mergeRequirements(acc, readProfile(dir, `${v}${PROFILE_EXT}`)), readProfile(dir, BASE_PROFILE));
|
|
207
213
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tex-requirements.js","sourceRoot":"","sources":["../src/tex-requirements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,6FAA6F;AAC7F,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC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
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type ClassLine, type Outline, type Span, type TextRun } from "./domain/tex-document.ts";
|
|
2
|
+
import type { LatexReader } from "./ports/latex.ts";
|
|
3
|
+
import { type Preset } from "./presets.ts";
|
|
4
|
+
import type { Finding, VenueRuleDeps } from "./venue-rules.ts";
|
|
5
|
+
/** A finding and where it points; null points at the top of the file. */
|
|
6
|
+
export interface Located extends Finding {
|
|
7
|
+
readonly at: Span | null;
|
|
8
|
+
}
|
|
9
|
+
/** The slice of ESLint's rule context these rules use. `raw` exists on the `.tex` language's. */
|
|
10
|
+
export interface TexRuleContext {
|
|
11
|
+
readonly filename: string;
|
|
12
|
+
/** The rule's options from the config, as ESLint validated them against its schema. */
|
|
13
|
+
readonly options?: readonly unknown[];
|
|
14
|
+
readonly sourceCode: {
|
|
15
|
+
readonly text: string;
|
|
16
|
+
readonly raw?: string;
|
|
17
|
+
getLocFromIndex(index: number): Readonly<{
|
|
18
|
+
line: number;
|
|
19
|
+
column: number;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
report(d: {
|
|
23
|
+
readonly loc: {
|
|
24
|
+
readonly start: {
|
|
25
|
+
line: number;
|
|
26
|
+
column: number;
|
|
27
|
+
};
|
|
28
|
+
readonly end: {
|
|
29
|
+
line: number;
|
|
30
|
+
column: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
} & ({
|
|
34
|
+
readonly messageId: string;
|
|
35
|
+
readonly data?: Readonly<Record<string, string | number>>;
|
|
36
|
+
} | {
|
|
37
|
+
readonly message: string;
|
|
38
|
+
})): void;
|
|
39
|
+
}
|
|
40
|
+
export interface TexRuleModule {
|
|
41
|
+
readonly meta: {
|
|
42
|
+
readonly type: "problem" | "suggestion";
|
|
43
|
+
readonly docs: {
|
|
44
|
+
readonly description: string;
|
|
45
|
+
readonly url: string;
|
|
46
|
+
};
|
|
47
|
+
readonly schema: readonly object[];
|
|
48
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
49
|
+
};
|
|
50
|
+
create(context: TexRuleContext): {
|
|
51
|
+
root?: () => void;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The paper's class line against the preset's template: a template the reader cannot read is said
|
|
56
|
+
* once; then the class must be there, name a class, be the template's class, and carry every
|
|
57
|
+
* option the template names.
|
|
58
|
+
*/
|
|
59
|
+
export declare function judgeTemplate(line: ClassLine, preset: Preset, latex: Pick<LatexReader, "template">): readonly Located[];
|
|
60
|
+
/** Every section the preset requires, against the paper's outline. */
|
|
61
|
+
export declare function judgeRequiredSections(outline: () => Outline, preset: Preset): readonly Located[];
|
|
62
|
+
/** Another shipped venue: the word for it, and what it is called in a paper's text. */
|
|
63
|
+
export interface OtherVenue {
|
|
64
|
+
readonly label: string;
|
|
65
|
+
readonly aliases: readonly string[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Each place the rendered text names another venue — one of its aliases as a whole word, case
|
|
69
|
+
* and all — unless that alias is also this paper's venue's own (a shared parent conference).
|
|
70
|
+
*/
|
|
71
|
+
export declare function judgeLeftover(runs: readonly TextRun[], preset: Preset, others: readonly OtherVenue[]): readonly Located[];
|
|
72
|
+
/** Where a rule's page lives: `docs/rules/tex/<name>.md` on the default branch. */
|
|
73
|
+
export declare const ruleDocsUrl: (name: TexVenueRuleName | "claim-provenance" | "register") => string;
|
|
74
|
+
export type TexVenueRuleName = "template" | "required-section" | "venue-leftover";
|
|
75
|
+
/** The level each rule is on at in paperlint's own config, for every `paper.tex`. */
|
|
76
|
+
export declare const TEX_VENUE_RULE_LEVELS: Readonly<Record<`tex/${TexVenueRuleName}`, "error" | "warn">>;
|
|
77
|
+
/**
|
|
78
|
+
* Every shipped venue but the ones on this paper's own chain, each resolved the way a paper
|
|
79
|
+
* extending it would be. A preset that does not resolve is skipped: `pdf/profile` owns that.
|
|
80
|
+
*/
|
|
81
|
+
export declare function otherVenues(preset: Preset, fromFile: string, deps: VenueRuleDeps): readonly OtherVenue[];
|
|
82
|
+
/** What the venue-conformance rules are built with: the preset store, and the LaTeX reader. */
|
|
83
|
+
export interface TexVenueRuleDeps extends VenueRuleDeps {
|
|
84
|
+
readonly latex: LatexReader;
|
|
85
|
+
}
|
|
86
|
+
/** The venue-conformance rules, as rules of the `tex` plugin (beside `tex/future-promise`). */
|
|
87
|
+
export declare function texVenueRules(deps: TexVenueRuleDeps): Readonly<Record<TexVenueRuleName, TexRuleModule>>;
|
|
88
|
+
//# sourceMappingURL=tex-venue-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tex-venue-rules.d.ts","sourceRoot":"","sources":["../src/tex-venue-rules.ts"],"names":[],"mappings":"AAwBA,OAAO,EAOL,KAAK,SAAS,EAGd,KAAK,OAAO,EAEZ,KAAK,IAAI,EACT,KAAK,OAAO,EACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D,yEAAyE;AACzE,MAAM,WAAW,OAAQ,SAAQ,OAAO;IACtC,QAAQ,CAAC,EAAE,EAAE,IAAI,GAAG,IAAI,CAAC;CAC1B;AAED,iGAAiG;AACjG,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uFAAuF;IACvF,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QACtB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM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ES OVER THE SOURCE — `paper.tex` judged against what its venue preset
|
|
3
|
+
* requires of the LaTeX itself, before any build:
|
|
4
|
+
*
|
|
5
|
+
* tex/template error the `\documentclass` is the preset's class, with every option it names
|
|
6
|
+
* tex/required-section error each section the preset requires is there, titled exactly, and
|
|
7
|
+
* where the preset says (`last`: after every section of the body)
|
|
8
|
+
* tex/venue-leftover warn the text a reader sees names ANOTHER shipped venue — its `name`
|
|
9
|
+
* or one of its `aliases` — than the one the paper extends
|
|
10
|
+
*
|
|
11
|
+
* ── WHY THEY LIVE HERE AND NOT IN `eslint-rules/` ────────────────────────────────
|
|
12
|
+
* Like the `pdf/*` venue rules (`venue-rules.ts`), they need the paper's resolved preset —
|
|
13
|
+
* `paperPreset`, the one answer to "which venue is this paper judged against" — and read it through
|
|
14
|
+
* the `Files` port. What they read of the source comes through the `LatexReader` port
|
|
15
|
+
* (`src/ports/latex.ts`, implemented over unified-latex in `src/adapters/latex/`): the parse tree of
|
|
16
|
+
* `sourceCode.raw`, never a search of the text.
|
|
17
|
+
*
|
|
18
|
+
* ── WHO SPEAKS WHEN THERE IS NOTHING TO JUDGE ───────────────────────────────────
|
|
19
|
+
* No `paperlint.json`, no `extends`, or a preset that does not resolve: silent. `pdf/measured` and
|
|
20
|
+
* `pdf/profile` already say so, once. A preset that names no template: silent — there is nothing to
|
|
21
|
+
* compare, and a template-family preset is where it is named.
|
|
22
|
+
*/
|
|
23
|
+
import { basename, dirname, join } from "node:path";
|
|
24
|
+
import { CONFIG_FILE } from "#lib/paper-config";
|
|
25
|
+
import { collapse, documentClassLine, missingOptions, runText, spanIn, } from "./domain/tex-document.js";
|
|
26
|
+
import { paperPreset, resolvePreset, SHIPPED_PREFIX, shippedPresets, } from "./presets.js";
|
|
27
|
+
import { readPaper, reportInPaper } from "./tex-paper.js";
|
|
28
|
+
// ── the judges: what the source says + a resolved preset → findings. Pure. ─────────
|
|
29
|
+
/** A place as a finding points at it: its span, or null — the top of the file — when unplaced. */
|
|
30
|
+
const spanOf = (p) => (p.kind === "at" ? p.span : null);
|
|
31
|
+
/** A class line that names a class, against the template's: the same class, with every option. */
|
|
32
|
+
function judgeClass(line, want, data) {
|
|
33
|
+
const at = spanOf(line.place);
|
|
34
|
+
if (line.cls !== want.cls)
|
|
35
|
+
return [{ messageId: "wrongClass", data: { ...data, got: line.cls }, at }];
|
|
36
|
+
return missingOptions(line, want).map((option) => ({
|
|
37
|
+
messageId: "missingOption",
|
|
38
|
+
data: { ...data, option },
|
|
39
|
+
at,
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
/** A candidate as the message names it: its line, or an empty `\documentclass{}`. */
|
|
43
|
+
const candidateLine = (c) => c.kind === "class" ? documentClassLine(c) : "\\documentclass{}";
|
|
44
|
+
/**
|
|
45
|
+
* Several class lines behind a TeX switch: satisfied when any candidate is the template's class
|
|
46
|
+
* with its options; otherwise one finding, at the first candidate, naming every one.
|
|
47
|
+
*/
|
|
48
|
+
function judgeCandidates(candidates, want, data) {
|
|
49
|
+
const matches = candidates.some((c) => c.kind === "class" && judgeClass(c, want, data).length === 0);
|
|
50
|
+
if (matches)
|
|
51
|
+
return [];
|
|
52
|
+
const named = candidates.map((c) => `\`${candidateLine(c)}\``).join(", ");
|
|
53
|
+
const found = { ...data, count: candidates.length, candidates: named };
|
|
54
|
+
return [
|
|
55
|
+
{ messageId: "noCandidate", data: found, at: spanOf(candidates[0].place) },
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
/** The paper's class line against a template that was read: present, naming a class, that class. */
|
|
59
|
+
function judgeClassLine(line, want, data) {
|
|
60
|
+
switch (line.kind) {
|
|
61
|
+
case "missing":
|
|
62
|
+
return [{ messageId: "noClass", data, at: null }];
|
|
63
|
+
case "empty":
|
|
64
|
+
return [{ messageId: "emptyClass", data, at: spanOf(line.place) }];
|
|
65
|
+
case "class":
|
|
66
|
+
return judgeClass(line, want, data);
|
|
67
|
+
case "ambiguous":
|
|
68
|
+
return judgeCandidates(line.candidates, want, data);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The paper's class line against the preset's template: a template the reader cannot read is said
|
|
73
|
+
* once; then the class must be there, name a class, be the template's class, and carry every
|
|
74
|
+
* option the template names.
|
|
75
|
+
*/
|
|
76
|
+
export function judgeTemplate(line, preset, latex) {
|
|
77
|
+
const t = preset.template;
|
|
78
|
+
if (t === null)
|
|
79
|
+
return [];
|
|
80
|
+
const want = latex.template(t.text);
|
|
81
|
+
if (want === null) {
|
|
82
|
+
const data = { file: t.file, text: JSON.stringify(t.text) };
|
|
83
|
+
return [{ messageId: "badTemplate", data, at: null }];
|
|
84
|
+
}
|
|
85
|
+
const data = { venue: preset.label, template: documentClassLine(want) };
|
|
86
|
+
return judgeClassLine(line, want, data);
|
|
87
|
+
}
|
|
88
|
+
/** Where a heading starts, or null when the parser gave it no place. */
|
|
89
|
+
const startOf = (p) => p.kind === "at" ? p.span.start : null;
|
|
90
|
+
/** A required section that is absent, reported where the document ends — where it would go. */
|
|
91
|
+
const missingSection = (outline, data) => ({
|
|
92
|
+
messageId: "missing",
|
|
93
|
+
data,
|
|
94
|
+
at: outline.end === null ? null : { start: outline.end, end: outline.end },
|
|
95
|
+
});
|
|
96
|
+
/** The first section of the body that starts after `start` and is not titled `title`. */
|
|
97
|
+
function bodySectionAfter(outline, start, title) {
|
|
98
|
+
const backMatter = outline.backMatter ?? Number.POSITIVE_INFINITY;
|
|
99
|
+
return outline.sections.find((h) => {
|
|
100
|
+
const s = startOf(h.place);
|
|
101
|
+
return s !== null && s > start && s < backMatter && h.title !== title;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* One required section against the outline: missing (reported where the document ends, where it
|
|
106
|
+
* would go), or — for `last` — standing before a section of the body. The body is every section
|
|
107
|
+
* before the appendix and the bibliography, so the required one may follow the bibliography. A
|
|
108
|
+
* heading without a place cannot be ordered, so it is never reported as out of order.
|
|
109
|
+
*/
|
|
110
|
+
function judgeSection(outline, want, venue) {
|
|
111
|
+
const title = collapse(want.title);
|
|
112
|
+
const last = outline.sections.filter((h) => h.title === title).at(-1);
|
|
113
|
+
const data = { venue, title };
|
|
114
|
+
if (last === undefined)
|
|
115
|
+
return [missingSection(outline, data)];
|
|
116
|
+
const lastStart = startOf(last.place);
|
|
117
|
+
if (want.position !== "last" || lastStart === null)
|
|
118
|
+
return [];
|
|
119
|
+
const after = bodySectionAfter(outline, lastStart, title);
|
|
120
|
+
if (after === undefined)
|
|
121
|
+
return [];
|
|
122
|
+
const notLast = { ...data, after: after.title };
|
|
123
|
+
return [{ messageId: "notLast", data: notLast, at: spanOf(last.place) }];
|
|
124
|
+
}
|
|
125
|
+
/** Every section the preset requires, against the paper's outline. */
|
|
126
|
+
export function judgeRequiredSections(outline, preset) {
|
|
127
|
+
if (preset.requiredSections.length === 0)
|
|
128
|
+
return [];
|
|
129
|
+
const o = outline();
|
|
130
|
+
return preset.requiredSections.flatMap((r) => judgeSection(o, r, preset.label));
|
|
131
|
+
}
|
|
132
|
+
/** `s` as a pattern that matches it literally. */
|
|
133
|
+
const literal = (s) => s.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
134
|
+
/**
|
|
135
|
+
* Each place the rendered text names another venue — one of its aliases as a whole word, case
|
|
136
|
+
* and all — unless that alias is also this paper's venue's own (a shared parent conference).
|
|
137
|
+
*/
|
|
138
|
+
export function judgeLeftover(runs, preset, others) {
|
|
139
|
+
const own = new Set(preset.aliases);
|
|
140
|
+
const names = others.flatMap((o) => o.aliases
|
|
141
|
+
.filter((a) => !own.has(a))
|
|
142
|
+
.map((alias) => ({
|
|
143
|
+
other: o.label,
|
|
144
|
+
re: new RegExp(`(?<![\\p{L}\\p{N}])${literal(alias)}(?![\\p{L}\\p{N}])`, "gu"),
|
|
145
|
+
})));
|
|
146
|
+
return runs.flatMap((run) => names.flatMap(({ other, re }) => [...runText(run).matchAll(re)].map((m) => ({
|
|
147
|
+
messageId: "leftover",
|
|
148
|
+
data: { name: m[0], other, venue: preset.label },
|
|
149
|
+
at: spanIn(run, m.index, m.index + m[0].length),
|
|
150
|
+
}))));
|
|
151
|
+
}
|
|
152
|
+
/** Where a rule's page lives: `docs/rules/tex/<name>.md` on the default branch. */
|
|
153
|
+
export const ruleDocsUrl = (name) => `https://github.com/zernie/paperlint/blob/main/docs/rules/tex/${name}.md`;
|
|
154
|
+
const RULES = {
|
|
155
|
+
template: {
|
|
156
|
+
judge: (r) => judgeTemplate(r.latex.documentClass(r.src), r.preset, r.latex),
|
|
157
|
+
meta: {
|
|
158
|
+
type: "problem",
|
|
159
|
+
docs: {
|
|
160
|
+
description: "the \\documentclass is the venue preset's class, with every option the preset names",
|
|
161
|
+
url: ruleDocsUrl("template"),
|
|
162
|
+
},
|
|
163
|
+
schema: [],
|
|
164
|
+
messages: {
|
|
165
|
+
noClass: "paper.tex has no \\documentclass; {{venue}} requires `{{template}}`",
|
|
166
|
+
emptyClass: "the \\documentclass names no class; {{venue}} requires `{{template}}`",
|
|
167
|
+
badTemplate: '{{file}}: the preset\'s "template" {{text}} is neither a \\documentclass line nor a class name, so the class cannot be checked',
|
|
168
|
+
wrongClass: "the class is `{{got}}`, and {{venue}} requires `{{template}}` — the page size, fonts and layout the venue checks come from the class",
|
|
169
|
+
missingOption: "the class option `{{option}}` is missing: {{venue}} requires `{{template}}`",
|
|
170
|
+
noCandidate: "none of the {{count}} \\documentclass lines is `{{template}}`, which {{venue}} requires: {{candidates}}. The source picks one behind a TeX switch, which is not evaluated; make one of them the venue's",
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
"required-section": {
|
|
175
|
+
judge: (r) => judgeRequiredSections(() => r.latex.outline(r.src), r.preset),
|
|
176
|
+
meta: {
|
|
177
|
+
type: "problem",
|
|
178
|
+
docs: {
|
|
179
|
+
description: "every section the venue preset requires is there, titled exactly, and where the preset says",
|
|
180
|
+
url: ruleDocsUrl("required-section"),
|
|
181
|
+
},
|
|
182
|
+
schema: [],
|
|
183
|
+
messages: {
|
|
184
|
+
missing: "{{venue}} requires a section titled «{{title}}» and there is none — add `\\section*{{{title}}}` (the title exactly; a bold paragraph does not count)",
|
|
185
|
+
notLast: "«{{title}}» must close the paper at {{venue}}, and the section «{{after}}» comes after it — move it after the last section of the body (after the bibliography is fine)",
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
"venue-leftover": {
|
|
190
|
+
judge: (r) => judgeLeftover(r.latex.renderedRuns(r.src), r.preset, r.others()),
|
|
191
|
+
meta: {
|
|
192
|
+
type: "suggestion",
|
|
193
|
+
docs: {
|
|
194
|
+
description: "the text names another shipped venue than the one the paper extends — a leftover from an earlier submission",
|
|
195
|
+
url: ruleDocsUrl("venue-leftover"),
|
|
196
|
+
},
|
|
197
|
+
schema: [],
|
|
198
|
+
messages: {
|
|
199
|
+
leftover: "«{{name}}» names {{other}}, and this paper extends {{venue}} — a leftover from an earlier submission? A reviewer reads it before the abstract. Comments and citation keys are not reported; a sentence that names the other venue on purpose can keep it with a disable directive",
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
/** The level each rule is on at in paperlint's own config, for every `paper.tex`. */
|
|
205
|
+
export const TEX_VENUE_RULE_LEVELS = {
|
|
206
|
+
"tex/template": "error",
|
|
207
|
+
"tex/required-section": "error",
|
|
208
|
+
"tex/venue-leftover": "warn",
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Every shipped venue but the ones on this paper's own chain, each resolved the way a paper
|
|
212
|
+
* extending it would be. A preset that does not resolve is skipped: `pdf/profile` owns that.
|
|
213
|
+
*/
|
|
214
|
+
export function otherVenues(preset, fromFile, deps) {
|
|
215
|
+
return shippedPresets(deps.venuesDir).flatMap((name) => {
|
|
216
|
+
const r = resolvePreset(`${SHIPPED_PREFIX}${name}`, fromFile, deps);
|
|
217
|
+
// A preset all of whose files are on this paper's chain is this venue or one it extends.
|
|
218
|
+
return r.ok && !r.value.chain.every((f) => preset.chain.includes(f))
|
|
219
|
+
? [{ label: r.value.label, aliases: r.value.aliases }]
|
|
220
|
+
: [];
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* What a judge reads for the paper whose `paper.tex` is `filename` — the paper with its includes
|
|
225
|
+
* spliced (`readPaper`) — or null when the paper has no resolved preset (`pdf/measured` and
|
|
226
|
+
* `pdf/profile` already say so).
|
|
227
|
+
*/
|
|
228
|
+
function readingOf(filename, src, deps) {
|
|
229
|
+
const dir = dirname(filename);
|
|
230
|
+
const p = paperPreset(dir, deps);
|
|
231
|
+
if (p.kind !== "resolved")
|
|
232
|
+
return null;
|
|
233
|
+
const preset = p.preset;
|
|
234
|
+
const others = () => otherVenues(preset, join(dir, CONFIG_FILE), deps);
|
|
235
|
+
const paper = readPaper(filename, src, deps);
|
|
236
|
+
return {
|
|
237
|
+
reading: { src: paper.text, latex: deps.latex, preset, others },
|
|
238
|
+
paper,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function rule(name, deps) {
|
|
242
|
+
const { judge, meta } = RULES[name];
|
|
243
|
+
return {
|
|
244
|
+
meta,
|
|
245
|
+
create(context) {
|
|
246
|
+
// Judged once per paper, on its paper.tex: the paper directory is the file's directory.
|
|
247
|
+
if (basename(context.filename) !== "paper.tex")
|
|
248
|
+
return {};
|
|
249
|
+
return {
|
|
250
|
+
root() {
|
|
251
|
+
const sc = context.sourceCode;
|
|
252
|
+
const r = readingOf(context.filename, sc.raw ?? sc.text, deps);
|
|
253
|
+
if (r !== null)
|
|
254
|
+
reportInPaper(context, meta.messages, r.paper, judge(r.reading));
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
/** The venue-conformance rules, as rules of the `tex` plugin (beside `tex/future-promise`). */
|
|
261
|
+
export function texVenueRules(deps) {
|
|
262
|
+
return {
|
|
263
|
+
template: rule("template", deps),
|
|
264
|
+
"required-section": rule("required-section", deps),
|
|
265
|
+
"venue-leftover": rule("venue-leftover", deps),
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=tex-venue-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tex-venue-rules.js","sourceRoot":"","sources":["../src/tex-venue-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,MAAM,GASP,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,cAAc,GAEf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA6C1D,sFAAsF;AAEtF,kGAAkG;AAClG,MAAM,MAAM,GAAG,CAAC,CAAQ,EAAe,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAW5E,kGAAkG;AAClG,SAAS,UAAU,CACjB,IAAoD,EACpD,IAAmB,EACnB,IAAkB;IAElB,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG;QACvB,OAAO,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7E,OAAO,cAAc,CAAC,IAAI,EAAE,IA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AE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC;QAClD,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC;KAC/C,CAAC;AACJ,CAAC"}
|
package/dist/venue-rules.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export type Assessment = {
|
|
|
42
42
|
};
|
|
43
43
|
export interface VenueRuleDeps {
|
|
44
44
|
readonly files: Files;
|
|
45
|
-
/** The package's
|
|
45
|
+
/** The package's presets directory (`presetsDir()`): the shipped presets and their schema. */
|
|
46
46
|
readonly venuesDir: string;
|
|
47
47
|
}
|
|
48
48
|
/** One paper, assessed. Reads through `deps.files` only; never throws on a paper's files. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"venue-rules.d.ts","sourceRoot":"","sources":["../src/venue-rules.ts"],"names":[],"mappings":"AAoCA,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAK9C,qEAAqE;AACrE,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;CAC1D;AAOD,kGAAkG;AAClG,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;KAAE,GA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A;aAAE,CAAC;SAChD,CAAC;QACF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;KAC3D,GAAG,IAAI,CAAC;CACV;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY,CAAC;QACxC,QAAQ,CAAC,IAAI,EAAE;YAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;SAAE,CAAC;QAChD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;QACnC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KACrD,CAAC;IACF,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;CAC1D;AA0DD,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAoHvC,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,SAAS,GACT,UAAU,GACV,OAAO,GACP,UAAU,GACV,QAAQ,GACR,WAAW,CAAC;AAEhB;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CACtC,MAAM,CAAC,OAAO,aAAa,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,CASjD,CAAC;AAwCF,sFAAsF;AACtF,wBAAgB,UAAU,CACxB,IAAI,EAAE,aAAa,GAClB,MAAM,CAAC,aAAa,EAAE,eAAe,CAAC,CAWxC"}
|
package/docs/configuration.md
CHANGED
|
@@ -15,7 +15,8 @@ venues/usenix-sec.jsonc (optional, your own) a VENUE PRESET: format, page l
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
The shipped presets (`paperlint:<name>`) live in the package, under
|
|
18
|
-
`
|
|
18
|
+
`presets/`: `acm-sigconf`, `agenticdev`, `aidc`, `aisec`,
|
|
19
|
+
`ieee-conference`, `realm`.
|
|
19
20
|
|
|
20
21
|
## The root `paperlint.json`
|
|
21
22
|
|
|
@@ -229,7 +230,7 @@ write. It prints its plan first, one line per step, then runs it:
|
|
|
229
230
|
|
|
230
231
|
```
|
|
231
232
|
papers/my-paper
|
|
232
|
-
inputs: TEXINPUTS += <paperlint>/
|
|
233
|
+
inputs: TEXINPUTS += <paperlint>/presets/tex
|
|
233
234
|
compile: paper.tex (\documentclass[sigconf,screen]{acmart}, venue agenticdev)
|
|
234
235
|
measure: pdf.js → _build/paper.facts.json (facts for the lint rules; nothing is judged here)
|
|
235
236
|
✓ paper.pdf — 4 pdflatex passes, 1 bibtex run; facts: _build/paper.facts.json, last page 621.5 / 264.8 pt
|