paperlint 20.6.1 → 20.7.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/.claude-plugin/plugin.json +1 -1
- package/dist/default-levels.d.ts +5 -0
- package/dist/default-levels.d.ts.map +1 -0
- package/dist/default-levels.js +36 -0
- package/dist/default-levels.js.map +1 -0
- package/dist/domain/preset-submission-fields.d.ts +15 -0
- package/dist/domain/preset-submission-fields.d.ts.map +1 -0
- package/dist/domain/preset-submission-fields.js +25 -0
- package/dist/domain/preset-submission-fields.js.map +1 -0
- package/dist/domain/venue-scope.d.ts +29 -0
- package/dist/domain/venue-scope.d.ts.map +1 -0
- package/dist/domain/venue-scope.js +18 -0
- package/dist/domain/venue-scope.js.map +1 -0
- package/dist/folder-venue-rule.d.ts +1 -1
- package/dist/folder-venue-rule.d.ts.map +1 -1
- package/dist/folder-venue-rule.js.map +1 -1
- package/dist/preset-merge.d.ts +34 -0
- package/dist/preset-merge.d.ts.map +1 -0
- package/dist/preset-merge.js +89 -0
- package/dist/preset-merge.js.map +1 -0
- package/dist/presets.d.ts +3 -2
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +3 -84
- package/dist/presets.js.map +1 -1
- package/dist/tex-requirements.d.ts +4 -1
- package/dist/tex-requirements.d.ts.map +1 -1
- package/dist/tex-requirements.js +3 -20
- package/dist/tex-requirements.js.map +1 -1
- package/dist/tex-venue-rules.d.ts +4 -24
- package/dist/tex-venue-rules.d.ts.map +1 -1
- package/dist/tex-venue-rules.js +6 -84
- package/dist/tex-venue-rules.js.map +1 -1
- package/dist/venue-leftover.d.ts +50 -0
- package/dist/venue-leftover.d.ts.map +1 -0
- package/dist/venue-leftover.js +129 -0
- package/dist/venue-leftover.js.map +1 -0
- package/docs/rules/tex/venue-leftover.md +34 -3
- package/docs/rules.md +1 -1
- package/docs/venues.md +6 -4
- package/package.json +2 -1
- package/presets/acl-latex.md +1 -1
- package/presets/langcode-2027.jsonc +106 -0
- package/presets/langcode-2027.md +79 -0
- package/presets/naacl-2027.jsonc +19 -0
- package/presets/naacl-2027.md +42 -0
- package/presets/venue-profile.schema.json +22 -1
- package/scripts/eslint-file-length.mjs +5 -5
- package/scripts/release-config.test.ts +114 -0
- package/scripts/release-type.test.ts +86 -0
- package/scripts/release-type.ts +76 -0
- package/scripts/semantic-release-plugins.d.ts +20 -1
- package/src/default-levels.test.ts +43 -0
- package/src/default-levels.ts +53 -0
- package/src/domain/preset-submission-fields.ts +49 -0
- package/src/domain/venue-scope.test.ts +33 -0
- package/src/domain/venue-scope.ts +39 -0
- package/src/folder-venue-rule.ts +2 -1
- package/src/paper-settings-commands.test.ts +1 -1
- package/src/preset-card-rule.test.ts +2 -0
- package/src/preset-merge.ts +141 -0
- package/src/presets-scope.test.ts +177 -0
- package/src/presets.test.ts +17 -56
- package/src/presets.ts +5 -130
- package/src/rule-cases.test.ts +10 -3
- package/src/tex-requirements.ts +14 -45
- package/src/tex-venue-rules.test.ts +66 -154
- package/src/tex-venue-rules.ts +25 -146
- package/src/venue-leftover.test.ts +112 -0
- package/src/venue-leftover.ts +207 -0
- package/src/venue-rules.test.ts +2 -2
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A venue's `scope` (`presets/venue-profile.schema.json`): what its call says it is for, verbatim.
|
|
3
|
+
* Parsed by `parsePreset`, merged by `resolvePreset`, and recorded on every shipped venue preset
|
|
4
|
+
* except the editions listed in `WITHOUT_SCOPE`.
|
|
5
|
+
*/
|
|
6
|
+
import { readdirSync, readFileSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { describe, expect, it } from "vitest";
|
|
9
|
+
import { memoryFiles } from "./adapters/memory/index.ts";
|
|
10
|
+
import { presetsDir } from "./package-dirs.ts";
|
|
11
|
+
import { parsePreset } from "./tex-requirements.ts";
|
|
12
|
+
import { resolvePreset, shippedPresets } from "./presets.ts";
|
|
13
|
+
|
|
14
|
+
const VENUES = presetsDir();
|
|
15
|
+
const shipped = Object.fromEntries(
|
|
16
|
+
readdirSync(VENUES)
|
|
17
|
+
.filter((f) => f.endsWith(".jsonc"))
|
|
18
|
+
.map((f) => [join(VENUES, f), readFileSync(join(VENUES, f))]),
|
|
19
|
+
);
|
|
20
|
+
const PAPER_FILE = "/work/papers/p/paperlint.json";
|
|
21
|
+
const resolve = (spec: string, extra: Record<string, string> = {}) =>
|
|
22
|
+
resolvePreset(spec, PAPER_FILE, {
|
|
23
|
+
files: memoryFiles({ ...shipped, ...extra }),
|
|
24
|
+
venuesDir: VENUES,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const SCOPE = {
|
|
28
|
+
url: "https://example.org/cfp",
|
|
29
|
+
read: "2026-11-25",
|
|
30
|
+
sentences: ["We invite papers on X."],
|
|
31
|
+
topics: ["X in practice"],
|
|
32
|
+
};
|
|
33
|
+
const venue = (body: Record<string, unknown>, name = "Our Workshop") =>
|
|
34
|
+
JSON.stringify({
|
|
35
|
+
type: "venue",
|
|
36
|
+
name,
|
|
37
|
+
url: "https://example.org/cfp",
|
|
38
|
+
extends: "paperlint:acl-latex",
|
|
39
|
+
...body,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
/** What `parsePreset` throws for the preset `text`; "" when it parses. */
|
|
43
|
+
function refusalOf(text: string): string {
|
|
44
|
+
try {
|
|
45
|
+
parsePreset(text, "v.jsonc");
|
|
46
|
+
return "";
|
|
47
|
+
} catch (e) {
|
|
48
|
+
return e instanceof Error ? e.message : String(e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
describe("parsing a scope", () => {
|
|
53
|
+
it("a venue's scope is read whole, topics included", () => {
|
|
54
|
+
expect(parsePreset(venue({ scope: SCOPE }), "v.jsonc").scope).toEqual(
|
|
55
|
+
SCOPE,
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("a venue without a scope still parses, with none", () => {
|
|
60
|
+
// Guards: the field is optional, so no project's own preset breaks when it ships.
|
|
61
|
+
expect(parsePreset(venue({}), "v.jsonc").scope).toBeNull();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it.each([
|
|
65
|
+
["no sentence", { ...SCOPE, sentences: [] }, /scope\.sentences/u],
|
|
66
|
+
[
|
|
67
|
+
"an http page",
|
|
68
|
+
{ ...SCOPE, url: "http://example.org/cfp" },
|
|
69
|
+
/scope\.url/u,
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"a day that is not a date",
|
|
73
|
+
{ ...SCOPE, read: "25.11.2026" },
|
|
74
|
+
/scope\.read/u,
|
|
75
|
+
],
|
|
76
|
+
["an unknown key", { ...SCOPE, why: "x" }, /scope/u],
|
|
77
|
+
])("a scope with %s is refused, naming the field", (_, scope, field) => {
|
|
78
|
+
expect(refusalOf(venue({ scope }))).toMatch(field);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("a template family with a scope is refused: a family names no venue", () => {
|
|
82
|
+
expect(
|
|
83
|
+
refusalOf(
|
|
84
|
+
JSON.stringify({
|
|
85
|
+
type: "family",
|
|
86
|
+
extends: "paperlint:acl-latex",
|
|
87
|
+
scope: SCOPE,
|
|
88
|
+
}),
|
|
89
|
+
),
|
|
90
|
+
).toMatch(/scope/u);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe("merging a scope", () => {
|
|
95
|
+
it("a child venue's scope replaces its parent's whole", () => {
|
|
96
|
+
const own = { ...SCOPE, sentences: ["Ours."], topics: undefined };
|
|
97
|
+
const r = resolve("./child.jsonc", {
|
|
98
|
+
"/work/papers/p/base.jsonc": venue({ scope: SCOPE }, "Base"),
|
|
99
|
+
"/work/papers/p/child.jsonc": venue(
|
|
100
|
+
{ extends: "./base.jsonc", scope: own },
|
|
101
|
+
"Child",
|
|
102
|
+
),
|
|
103
|
+
});
|
|
104
|
+
expect(r.ok && r.value.scope).toEqual({ ...own, topics: [] });
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("a child venue without a scope keeps its parent's", () => {
|
|
108
|
+
const r = resolve("./child.jsonc", {
|
|
109
|
+
"/work/papers/p/base.jsonc": venue({ scope: SCOPE }, "Base"),
|
|
110
|
+
"/work/papers/p/child.jsonc": venue({ extends: "./base.jsonc" }, "Child"),
|
|
111
|
+
});
|
|
112
|
+
expect(r.ok && r.value.scope).toEqual(SCOPE);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("a workshop does not take the scope of the conference it is held at", () => {
|
|
116
|
+
// Guards: AGENT is held at ICSE, and ICSE's scope is not AGENT's (the reason scope exists).
|
|
117
|
+
const r = resolve("./w.jsonc", {
|
|
118
|
+
"/work/papers/p/conf-2027.jsonc": venue({ scope: SCOPE }, "Conf"),
|
|
119
|
+
"/work/papers/p/w-2027.jsonc": venue(
|
|
120
|
+
{ workshop: true, parent: "./conf-2027.jsonc" },
|
|
121
|
+
"W",
|
|
122
|
+
),
|
|
123
|
+
"/work/papers/p/w.jsonc": venue({ extends: "./w-2027.jsonc" }, "W2"),
|
|
124
|
+
});
|
|
125
|
+
expect(r.ok).toBe(true);
|
|
126
|
+
expect(r.ok && r.value.scope).toBeNull();
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// The shipped venue editions that do not record their call's scope yet. This list may only shrink:
|
|
131
|
+
// a new edition records its scope (`add-venue`), and filling one in removes it here.
|
|
132
|
+
const WITHOUT_SCOPE = [
|
|
133
|
+
"aaai-2027",
|
|
134
|
+
"acsac-2026",
|
|
135
|
+
"agent-2027",
|
|
136
|
+
"agenticdev-2026",
|
|
137
|
+
"agentverify-2027",
|
|
138
|
+
"aidc-2026",
|
|
139
|
+
"aisec-2026",
|
|
140
|
+
"ase-2026",
|
|
141
|
+
"ccs-2026",
|
|
142
|
+
"emnlp-2026",
|
|
143
|
+
"fse-2027",
|
|
144
|
+
"icml-2027",
|
|
145
|
+
"icse-2027",
|
|
146
|
+
"icse-2028",
|
|
147
|
+
"msr-2027",
|
|
148
|
+
"naacl-2027",
|
|
149
|
+
|
|
150
|
+
"neurips-2026",
|
|
151
|
+
"nlbse-2027",
|
|
152
|
+
"realm-2026",
|
|
153
|
+
"sp-2027",
|
|
154
|
+
];
|
|
155
|
+
|
|
156
|
+
describe("the shipped venue editions", () => {
|
|
157
|
+
const venues = shippedPresets(VENUES).filter((name) => {
|
|
158
|
+
const r = resolve(`paperlint:${name}`);
|
|
159
|
+
return r.ok && r.value.identity.type === "venue";
|
|
160
|
+
});
|
|
161
|
+
const scoped = (name: string) => {
|
|
162
|
+
const r = resolve(`paperlint:${name}`);
|
|
163
|
+
return r.ok && r.value.scope !== null;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
it("every venue edition records its scope, except the listed ones", () => {
|
|
167
|
+
expect(
|
|
168
|
+
venues.filter((n) => !scoped(n) && !WITHOUT_SCOPE.includes(n)),
|
|
169
|
+
).toEqual([]);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it("every listed edition still lacks its scope and still ships: the list only shrinks", () => {
|
|
173
|
+
expect(
|
|
174
|
+
WITHOUT_SCOPE.filter((n) => !venues.includes(n) || scoped(n)),
|
|
175
|
+
).toEqual([]);
|
|
176
|
+
});
|
|
177
|
+
});
|
package/src/presets.test.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { join, relative } from "node:path";
|
|
|
11
11
|
import { describe, expect, it } from "vitest";
|
|
12
12
|
import { memoryFiles } from "./adapters/memory/index.ts";
|
|
13
13
|
import { frozenText } from "../test/frozen-presets.ts";
|
|
14
|
+
import { SHIPPED_VENUES, shippedVenuesExcept } from "../test/shipped-venues.ts";
|
|
14
15
|
import { presetsDir } from "./package-dirs.ts";
|
|
15
16
|
import { parsePreset } from "./tex-requirements.ts";
|
|
16
17
|
import {
|
|
@@ -471,11 +472,21 @@ const DECLARED = {
|
|
|
471
472
|
url: "https://conf.researchr.org/track/icse-2028/icse-2028-papers",
|
|
472
473
|
},
|
|
473
474
|
"ieee-conference.jsonc": { type: "family" },
|
|
475
|
+
"langcode-2027.jsonc": {
|
|
476
|
+
type: "venue",
|
|
477
|
+
name: "LangCode",
|
|
478
|
+
url: "https://langcode2027.github.io/",
|
|
479
|
+
},
|
|
474
480
|
"msr-2027.jsonc": {
|
|
475
481
|
type: "venue",
|
|
476
482
|
name: "MSR",
|
|
477
483
|
url: "https://2027.msrconf.org/track/msr-2027-technical-papers",
|
|
478
484
|
},
|
|
485
|
+
"naacl-2027.jsonc": {
|
|
486
|
+
type: "venue",
|
|
487
|
+
name: "NAACL",
|
|
488
|
+
url: "https://2027.naacl.org/calls/main_conference_papers/",
|
|
489
|
+
},
|
|
479
490
|
"neurips-style.jsonc": { type: "family" },
|
|
480
491
|
"neurips-2026.jsonc": {
|
|
481
492
|
type: "venue",
|
|
@@ -767,7 +778,7 @@ describe("what does not resolve, and says why", () => {
|
|
|
767
778
|
"a shipped name with a typo",
|
|
768
779
|
"paperlint:agenticdve",
|
|
769
780
|
"not-found",
|
|
770
|
-
/aaai-2027, aaai-press, acl-latex, acm-acmsmall, acm-sigconf, acsac-2026, agent-2027, agenticdev-2026, agentverify-2027, aidc-2026, aisec-2026, ase-2026, ccs-2026, emnlp-2026, fse-2027, icml-2027, icml-style, icse-2027, icse-2028, ieee-conference, msr-2027, neurips-2026, neurips-style, nlbse-2027, realm-2026, sp-2027/,
|
|
781
|
+
/aaai-2027, aaai-press, acl-latex, acm-acmsmall, acm-sigconf, acsac-2026, agent-2027, agenticdev-2026, agentverify-2027, aidc-2026, aisec-2026, ase-2026, ccs-2026, emnlp-2026, fse-2027, icml-2027, icml-style, icse-2027, icse-2028, ieee-conference, langcode-2027, msr-2027, naacl-2027, neurips-2026, neurips-style, nlbse-2027, realm-2026, sp-2027/,
|
|
771
782
|
],
|
|
772
783
|
["the base TeX set", "paperlint:tex-base", "not-found", /agenticdev/],
|
|
773
784
|
[
|
|
@@ -1062,34 +1073,9 @@ describe("shippedVenueNames — what each shipped venue is called", () => {
|
|
|
1062
1073
|
it("every shipped preset, by its label and the names along its chain", () => {
|
|
1063
1074
|
const names = shippedVenueNames(deps());
|
|
1064
1075
|
// A venue is labelled by its `name`, a family by its file name.
|
|
1065
|
-
expect(names.map((n) => n.label)).toEqual(
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
"acl-latex",
|
|
1069
|
-
"acm-acmsmall",
|
|
1070
|
-
"acm-sigconf",
|
|
1071
|
-
"ACSAC",
|
|
1072
|
-
"AGENT",
|
|
1073
|
-
"AgenticDev",
|
|
1074
|
-
"AGENTVERIFY",
|
|
1075
|
-
"AIDC",
|
|
1076
|
-
"AISec",
|
|
1077
|
-
"ASE",
|
|
1078
|
-
"ACM CCS",
|
|
1079
|
-
"EMNLP",
|
|
1080
|
-
"FSE",
|
|
1081
|
-
"ICML",
|
|
1082
|
-
"icml-style",
|
|
1083
|
-
"ICSE",
|
|
1084
|
-
"ICSE",
|
|
1085
|
-
"ieee-conference",
|
|
1086
|
-
"MSR",
|
|
1087
|
-
"NeurIPS",
|
|
1088
|
-
"neurips-style",
|
|
1089
|
-
"NLBSE",
|
|
1090
|
-
"REALM",
|
|
1091
|
-
"IEEE S&P",
|
|
1092
|
-
]);
|
|
1076
|
+
expect(names.map((n) => n.label)).toEqual(
|
|
1077
|
+
SHIPPED_VENUES.map(([label]) => label),
|
|
1078
|
+
);
|
|
1093
1079
|
// AISec's parent conference is its `parent`, not an alias: ACM CCS is named by ccs alone.
|
|
1094
1080
|
expect(names.find((n) => n.label === "AISec")?.aliases).toEqual(["AISec"]);
|
|
1095
1081
|
// The year is the id's: two editions of one series share a name and differ by year.
|
|
@@ -1113,33 +1099,7 @@ describe("shippedVenueNames — what does not resolve", () => {
|
|
|
1113
1099
|
);
|
|
1114
1100
|
expect(
|
|
1115
1101
|
shippedVenueNames({ files, venuesDir: VENUES }).map((n) => n.label),
|
|
1116
|
-
).toEqual([
|
|
1117
|
-
"AAAI",
|
|
1118
|
-
"aaai-press",
|
|
1119
|
-
"acl-latex",
|
|
1120
|
-
"acm-acmsmall",
|
|
1121
|
-
"acm-sigconf",
|
|
1122
|
-
"ACSAC",
|
|
1123
|
-
"AGENT",
|
|
1124
|
-
"AgenticDev",
|
|
1125
|
-
"AGENTVERIFY",
|
|
1126
|
-
"AIDC",
|
|
1127
|
-
"AISec",
|
|
1128
|
-
"ASE",
|
|
1129
|
-
"ACM CCS",
|
|
1130
|
-
"EMNLP",
|
|
1131
|
-
"FSE",
|
|
1132
|
-
"ICML",
|
|
1133
|
-
"icml-style",
|
|
1134
|
-
"ICSE",
|
|
1135
|
-
"ICSE",
|
|
1136
|
-
"ieee-conference",
|
|
1137
|
-
"MSR",
|
|
1138
|
-
"NeurIPS",
|
|
1139
|
-
"neurips-style",
|
|
1140
|
-
"NLBSE",
|
|
1141
|
-
"IEEE S&P",
|
|
1142
|
-
]);
|
|
1102
|
+
).toEqual(shippedVenuesExcept("REALM").map(([label]) => label));
|
|
1143
1103
|
});
|
|
1144
1104
|
});
|
|
1145
1105
|
|
|
@@ -1222,6 +1182,7 @@ describe("a workshop's parent is the edition of its own year", () => {
|
|
|
1222
1182
|
["agentverify-2027", "paperlint:icse-2027"],
|
|
1223
1183
|
["aidc-2026", "paperlint:acsac-2026"],
|
|
1224
1184
|
["aisec-2026", "paperlint:ccs-2026"],
|
|
1185
|
+
["langcode-2027", "paperlint:naacl-2027"],
|
|
1225
1186
|
["nlbse-2027", "paperlint:icse-2027"],
|
|
1226
1187
|
["realm-2026", "paperlint:emnlp-2026"],
|
|
1227
1188
|
]);
|
package/src/presets.ts
CHANGED
|
@@ -20,16 +20,7 @@
|
|
|
20
20
|
*
|
|
21
21
|
* ── THE CHAIN ─────────────────────────────────────────────────────────────────────
|
|
22
22
|
* At most `MAX_PRESET_DEPTH` files, root to leaf. A cycle (relative paths can form one) is refused
|
|
23
|
-
* naming the chain. The chain is merged block by block
|
|
24
|
-
*
|
|
25
|
-
* tex union — a child never removes a package its parent needs
|
|
26
|
-
* format per key, the child wins; `kinds` by kind name, a child's kind replaces that kind
|
|
27
|
-
* rules per rule id, the child wins; `ruleOrigins` keeps which file set each
|
|
28
|
-
* template the child wins, with its `template_forbids`; so does `name`, and `required_sections`, `register`, `talk`,
|
|
29
|
-
* `portal`, `deadlines` and `submission_fields` (each whole)
|
|
30
|
-
* aliases union, with every `name` — what the venue is called along the chain
|
|
31
|
-
* parent the child wins: the conference a workshop is held at, a spec resolved from the
|
|
32
|
-
* file that names it
|
|
23
|
+
* naming the chain. The chain is merged block by block, by `src/preset-merge.ts`.
|
|
33
24
|
*
|
|
34
25
|
* ── ONE PRESET PER EDITION ────────────────────────────────────────────────────────
|
|
35
26
|
* A venue preset is one edition, `paperlint:<series>-<year>` (`src/domain/edition.ts`); a family's id
|
|
@@ -53,9 +44,6 @@
|
|
|
53
44
|
*/
|
|
54
45
|
import { basename, dirname, extname, join, resolve } from "node:path";
|
|
55
46
|
import {
|
|
56
|
-
mergeRequirements,
|
|
57
|
-
NO_FORMAT,
|
|
58
|
-
NO_REQUIREMENTS,
|
|
59
47
|
parsePreset,
|
|
60
48
|
profileFileOf,
|
|
61
49
|
venueNames,
|
|
@@ -65,6 +53,7 @@ import {
|
|
|
65
53
|
type TexRequirements,
|
|
66
54
|
type VenueFormat,
|
|
67
55
|
} from "./tex-requirements.ts";
|
|
56
|
+
import { mergeOne, NOTHING_MERGED, type ParentLink } from "./preset-merge.ts";
|
|
68
57
|
import { callerPath } from "./caller-path.ts";
|
|
69
58
|
import { err, isOk, ok, type Result } from "./domain/result.ts";
|
|
70
59
|
import type { Files } from "./ports/files.ts";
|
|
@@ -84,6 +73,7 @@ import type { VenueTalk } from "./domain/talk.ts";
|
|
|
84
73
|
import type { VenuePortal } from "./domain/submission.ts";
|
|
85
74
|
import type { VenueFields } from "./domain/submission-fields.ts";
|
|
86
75
|
import type { Reading } from "./domain/deadline.ts";
|
|
76
|
+
import type { VenueScope } from "./domain/venue-scope.ts";
|
|
87
77
|
|
|
88
78
|
/** The prefix of a shipped preset's spec. */
|
|
89
79
|
export const SHIPPED_PREFIX = "paperlint:";
|
|
@@ -166,6 +156,8 @@ export interface Preset {
|
|
|
166
156
|
readonly deadlines: readonly Reading[];
|
|
167
157
|
/** The fields the edition's submission form asks (`paperlint submission`); null when no file of the chain records any. */
|
|
168
158
|
readonly submissionFields: VenueFields | null;
|
|
159
|
+
/** What the call says the venue is for (`scope`), verbatim; null when no file of the chain records it. */
|
|
160
|
+
readonly scope: VenueScope | null;
|
|
169
161
|
}
|
|
170
162
|
|
|
171
163
|
/** Why a spec does not resolve. */
|
|
@@ -294,123 +286,6 @@ function chainUp(
|
|
|
294
286
|
return chainUp([...below, r.value], r.value, deps);
|
|
295
287
|
}
|
|
296
288
|
|
|
297
|
-
/** A child's format over its parent's: per key the child wins, kinds by name. Pure. */
|
|
298
|
-
export function mergeFormat(
|
|
299
|
-
parent: VenueFormat,
|
|
300
|
-
child: VenueFormat,
|
|
301
|
-
): VenueFormat {
|
|
302
|
-
// Every field listed: a VenueFormat literal missing one is a compile error.
|
|
303
|
-
const pick = <K extends Exclude<keyof VenueFormat, "kinds">>(
|
|
304
|
-
k: K,
|
|
305
|
-
): VenueFormat[K] => child[k] ?? parent[k];
|
|
306
|
-
return {
|
|
307
|
-
pageWidthIn: pick("pageWidthIn"),
|
|
308
|
-
pageHeightIn: pick("pageHeightIn"),
|
|
309
|
-
columns: pick("columns"),
|
|
310
|
-
bodyPt: pick("bodyPt"),
|
|
311
|
-
bodyPtTol: pick("bodyPtTol"),
|
|
312
|
-
refPtMin: pick("refPtMin"),
|
|
313
|
-
refPtMax: pick("refPtMax"),
|
|
314
|
-
fontsText: pick("fontsText"),
|
|
315
|
-
fontsTitle: pick("fontsTitle"),
|
|
316
|
-
bodyEndsAt: pick("bodyEndsAt"),
|
|
317
|
-
appendixInBody: pick("appendixInBody"),
|
|
318
|
-
kinds: new Map([...parent.kinds, ...child.kinds]),
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/** A venue's name; a family and the base set have none. Pure. */
|
|
323
|
-
const nameOf = (i: PresetIdentity): string | null =>
|
|
324
|
-
i.type === "venue" ? i.name : null;
|
|
325
|
-
|
|
326
|
-
/** A venue's name as a list, empty for a family and the base set. Pure. */
|
|
327
|
-
const namesOf = (i: PresetIdentity): readonly string[] =>
|
|
328
|
-
i.type === "venue" ? [i.name] : [];
|
|
329
|
-
|
|
330
|
-
/** What the merge carries from file to file: the preset without what only the whole chain knows. */
|
|
331
|
-
type Merging = Omit<
|
|
332
|
-
Preset,
|
|
333
|
-
"id" | "label" | "chain" | "identity" | "parentNames" | "year"
|
|
334
|
-
> & {
|
|
335
|
-
readonly name: string | null;
|
|
336
|
-
readonly parent: ParentLink | null;
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
/** A `parent` as a file of the chain names it: the spec, and the file it is resolved from. */
|
|
340
|
-
interface ParentLink {
|
|
341
|
-
readonly spec: string;
|
|
342
|
-
readonly file: string;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
const NOTHING_MERGED: Merging = {
|
|
346
|
-
name: null,
|
|
347
|
-
parent: null,
|
|
348
|
-
template: null,
|
|
349
|
-
templateStyle: null,
|
|
350
|
-
aliases: [],
|
|
351
|
-
declaredAliases: [],
|
|
352
|
-
blind: false,
|
|
353
|
-
requiredSections: [],
|
|
354
|
-
tex: NO_REQUIREMENTS,
|
|
355
|
-
format: NO_FORMAT,
|
|
356
|
-
rules: {},
|
|
357
|
-
ruleOrigins: {},
|
|
358
|
-
registerAnchors: [],
|
|
359
|
-
talk: null,
|
|
360
|
-
portal: null,
|
|
361
|
-
deadlines: [],
|
|
362
|
-
submissionFields: null,
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
/** The blocks a child replaces whole: the child's when it names one, else its parents'. Pure. */
|
|
366
|
-
const wholeBlocks = (
|
|
367
|
-
acc: Merging,
|
|
368
|
-
p: PresetFile,
|
|
369
|
-
): Pick<
|
|
370
|
-
Merging,
|
|
371
|
-
| "requiredSections"
|
|
372
|
-
| "registerAnchors"
|
|
373
|
-
| "talk"
|
|
374
|
-
| "portal"
|
|
375
|
-
| "deadlines"
|
|
376
|
-
| "submissionFields"
|
|
377
|
-
> => ({
|
|
378
|
-
requiredSections: p.requiredSections ?? acc.requiredSections,
|
|
379
|
-
registerAnchors: p.registerAnchors ?? acc.registerAnchors,
|
|
380
|
-
talk: p.talk ?? acc.talk,
|
|
381
|
-
portal: p.portal ?? acc.portal,
|
|
382
|
-
deadlines: p.deadlines ?? acc.deadlines,
|
|
383
|
-
submissionFields: p.submissionFields ?? acc.submissionFields,
|
|
384
|
-
});
|
|
385
|
-
|
|
386
|
-
/** One file of the chain, `file`, merged over what its parents gave. Pure. */
|
|
387
|
-
const mergeOne = (
|
|
388
|
-
acc: Merging,
|
|
389
|
-
{ preset: p, file }: { readonly preset: PresetFile; readonly file: string },
|
|
390
|
-
): Merging => ({
|
|
391
|
-
name: nameOf(p.identity) ?? acc.name,
|
|
392
|
-
parent: p.parent === null ? acc.parent : { spec: p.parent, file },
|
|
393
|
-
template:
|
|
394
|
-
p.template === null
|
|
395
|
-
? acc.template
|
|
396
|
-
: { text: p.template, file, forbids: p.templateForbids },
|
|
397
|
-
templateStyle:
|
|
398
|
-
p.templateStyle === null
|
|
399
|
-
? acc.templateStyle
|
|
400
|
-
: { text: p.templateStyle, file },
|
|
401
|
-
aliases: [...new Set([...acc.aliases, ...namesOf(p.identity), ...p.aliases])],
|
|
402
|
-
declaredAliases: [...new Set([...acc.declaredAliases, ...p.aliases])],
|
|
403
|
-
blind: p.blind ?? acc.blind,
|
|
404
|
-
tex: p.tex ? mergeRequirements(acc.tex, p.tex) : acc.tex,
|
|
405
|
-
format: mergeFormat(acc.format, p.format),
|
|
406
|
-
rules: { ...acc.rules, ...p.rules },
|
|
407
|
-
ruleOrigins: {
|
|
408
|
-
...acc.ruleOrigins,
|
|
409
|
-
...Object.fromEntries(Object.keys(p.rules).map((id) => [id, file])),
|
|
410
|
-
},
|
|
411
|
-
...wholeBlocks(acc, p),
|
|
412
|
-
});
|
|
413
|
-
|
|
414
289
|
/** The chain, root first, merged into one preset, and the parent it names. Pure. */
|
|
415
290
|
function merged(
|
|
416
291
|
spec: string,
|
package/src/rule-cases.test.ts
CHANGED
|
@@ -1408,13 +1408,20 @@ const CASES: Readonly<Record<string, RuleCases>> = {
|
|
|
1408
1408
|
}),
|
|
1409
1409
|
}),
|
|
1410
1410
|
},
|
|
1411
|
-
// EMNLP 2026, a shipped venue (REALM's conference), named with its year in a BlindConf paper's
|
|
1411
|
+
// EMNLP 2026, a shipped venue (REALM's conference), named with its year in a BlindConf paper's
|
|
1412
|
+
// front matter: the default reads prose before the first \section only (#552).
|
|
1412
1413
|
"tex/venue-leftover": {
|
|
1413
1414
|
reports: {
|
|
1414
|
-
tree:
|
|
1415
|
+
tree: paper(
|
|
1416
|
+
tex(
|
|
1417
|
+
`First written for EMNLP 2026.\n\\section{Introduction}\nText.\n${STATEMENT}`,
|
|
1418
|
+
IEEE,
|
|
1419
|
+
),
|
|
1420
|
+
BLIND_PAPER,
|
|
1421
|
+
),
|
|
1415
1422
|
file: TEX_FILE,
|
|
1416
1423
|
severity: 1,
|
|
1417
|
-
line:
|
|
1424
|
+
line: 3,
|
|
1418
1425
|
},
|
|
1419
1426
|
silent: blind("Text."),
|
|
1420
1427
|
},
|
package/src/tex-requirements.ts
CHANGED
|
@@ -34,16 +34,18 @@ import {
|
|
|
34
34
|
type VenueTalk,
|
|
35
35
|
type VenueTalkJson,
|
|
36
36
|
} from "./domain/talk.ts";
|
|
37
|
+
import {
|
|
38
|
+
submissionFieldsOf,
|
|
39
|
+
type SubmissionFieldsJson,
|
|
40
|
+
} from "./domain/preset-submission-fields.ts";
|
|
41
|
+
import {
|
|
42
|
+
scopeOf,
|
|
43
|
+
type VenueScope,
|
|
44
|
+
type VenueScopeJson,
|
|
45
|
+
} from "./domain/venue-scope.ts";
|
|
37
46
|
import type { VenuePortal } from "./domain/submission.ts";
|
|
38
47
|
import type { Reading } from "./domain/deadline.ts";
|
|
39
|
-
import {
|
|
40
|
-
RESERVED_FIELD_KEYS,
|
|
41
|
-
reservedKey,
|
|
42
|
-
declareField,
|
|
43
|
-
type FieldDeclaration,
|
|
44
|
-
type FieldJson,
|
|
45
|
-
type VenueFields,
|
|
46
|
-
} from "./domain/submission-fields.ts";
|
|
48
|
+
import type { VenueFields } from "./domain/submission-fields.ts";
|
|
47
49
|
|
|
48
50
|
/** CTAN package name → the names that prove it is installed. */
|
|
49
51
|
export type PackageProofs = Readonly<Record<string, readonly string[]>>;
|
|
@@ -231,6 +233,8 @@ export interface PresetFile {
|
|
|
231
233
|
readonly registerAnchors: readonly RegisterAnchor[] | null;
|
|
232
234
|
/** What the venue asks a presenter to send; null when the file has no `talk` block. */
|
|
233
235
|
readonly talk: VenueTalk | null;
|
|
236
|
+
/** What the call says the venue is for, verbatim; null when the file records none. */
|
|
237
|
+
readonly scope: VenueScope | null;
|
|
234
238
|
/** Where the venue takes submissions (`paperlint submission`); null when the file does not say. */
|
|
235
239
|
readonly portal: VenuePortal | null;
|
|
236
240
|
/** The edition's deadlines as they were read; null when the file names none (a child's list replaces its parent's). */
|
|
@@ -315,43 +319,7 @@ interface PresetBodyJson {
|
|
|
315
319
|
readonly portal?: VenuePortal;
|
|
316
320
|
readonly deadlines?: readonly Reading[];
|
|
317
321
|
readonly submission_fields?: SubmissionFieldsJson;
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
/** A preset's `submission_fields` after the schema accepted it. */
|
|
321
|
-
interface SubmissionFieldsJson {
|
|
322
|
-
readonly source: VenueFields["source"];
|
|
323
|
-
readonly url: string;
|
|
324
|
-
readonly read: string;
|
|
325
|
-
readonly fields: Readonly<Record<string, FieldJson>>;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/** A preset's `submission_fields`, or null when it records none; a reserved field name, or a field that contradicts its kind, is refused. */
|
|
329
|
-
function submissionFieldsOf(
|
|
330
|
-
j: SubmissionFieldsJson | undefined,
|
|
331
|
-
file: string,
|
|
332
|
-
): VenueFields | null {
|
|
333
|
-
if (j === undefined) return null;
|
|
334
|
-
const reserved = reservedKey(Object.keys(j.fields));
|
|
335
|
-
if (reserved !== null)
|
|
336
|
-
throw new Error(
|
|
337
|
-
`${file}: "submission_fields" names "${reserved}", which paperlint sends itself (${RESERVED_FIELD_KEYS.join(", ")}) — a field of that name would overwrite it`,
|
|
338
|
-
);
|
|
339
|
-
const declared = Object.entries(j.fields).map(
|
|
340
|
-
([key, f]) => [key, declareField(f)] as const,
|
|
341
|
-
);
|
|
342
|
-
const fields: readonly (readonly [string, FieldDeclaration])[] =
|
|
343
|
-
declared.flatMap(([key, d]) => (d.ok ? [[key, d.value] as const] : []));
|
|
344
|
-
const errors = declared.flatMap(([key, d]) =>
|
|
345
|
-
d.ok ? [] : [`field "${key}": ${d.error}`],
|
|
346
|
-
);
|
|
347
|
-
if (errors.length > 0)
|
|
348
|
-
throw new Error(`${file}: "submission_fields" ${errors.join("; ")}`);
|
|
349
|
-
return {
|
|
350
|
-
source: j.source,
|
|
351
|
-
url: j.url,
|
|
352
|
-
read: j.read,
|
|
353
|
-
fields: Object.fromEntries(fields),
|
|
354
|
-
};
|
|
322
|
+
readonly scope?: VenueScopeJson;
|
|
355
323
|
}
|
|
356
324
|
|
|
357
325
|
/** An optional field as the typed preset holds it: absent is null. */
|
|
@@ -565,6 +533,7 @@ export function parsePreset(
|
|
|
565
533
|
rules: j.rules ?? {},
|
|
566
534
|
registerAnchors: anchorsOf(j.register),
|
|
567
535
|
talk: j.talk === undefined ? null : venueTalkOf(j.talk),
|
|
536
|
+
scope: scopeOf(j.scope),
|
|
568
537
|
...portalBlocks(j, file),
|
|
569
538
|
};
|
|
570
539
|
}
|