paperlint 20.2.0 → 20.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/dist/adapters/venue-corpus/index.d.ts +17 -1
- package/dist/adapters/venue-corpus/index.d.ts.map +1 -1
- package/dist/adapters/venue-corpus/index.js +23 -7
- package/dist/adapters/venue-corpus/index.js.map +1 -1
- package/dist/cli.d.ts +4 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +42 -13
- package/dist/cli.js.map +1 -1
- package/dist/corpus-record-rule.d.ts +65 -0
- package/dist/corpus-record-rule.d.ts.map +1 -0
- package/dist/corpus-record-rule.js +85 -0
- package/dist/corpus-record-rule.js.map +1 -0
- package/dist/domain/corpus-record.d.ts +51 -0
- package/dist/domain/corpus-record.d.ts.map +1 -0
- package/dist/domain/corpus-record.js +119 -0
- package/dist/domain/corpus-record.js.map +1 -0
- package/dist/domain/venue-corpus.d.ts +25 -3
- package/dist/domain/venue-corpus.d.ts.map +1 -1
- package/dist/domain/venue-corpus.js +4 -0
- package/dist/domain/venue-corpus.js.map +1 -1
- package/dist/paper-files.d.ts +10 -3
- package/dist/paper-files.d.ts.map +1 -1
- package/dist/paper-files.js +17 -2
- package/dist/paper-files.js.map +1 -1
- package/dist/papers-roots.d.ts +6 -0
- package/dist/papers-roots.d.ts.map +1 -1
- package/dist/papers-roots.js +14 -0
- package/dist/papers-roots.js.map +1 -1
- package/docs/design/venue-corpus.md +48 -27
- package/docs/layout.md +2 -2
- package/docs/rules/corpus/record.md +119 -0
- package/docs/rules.md +1 -0
- package/docs/venues.md +31 -20
- package/eslint.config.mjs +1 -0
- package/package.json +2 -1
- package/scripts/eslint-file-length.mjs +3 -3
- package/skills/study-accepted-papers/SKILL.md +14 -8
- package/skills/study-accepted-papers/SKILL.md.spec.ts +13 -7
- package/skills/study-accepted-papers/papers.schema.json +49 -2
- package/skills/study-accepted-papers/scripts/corpus-licences-core.js +2 -2
- package/skills/study-accepted-papers/scripts/corpus-licences-core.ts +2 -1
- package/skills/study-accepted-papers/scripts/corpus-licences.js +19 -9
- package/skills/study-accepted-papers/scripts/corpus-licences.test.ts +4 -1
- package/src/adapters/venue-corpus/index.test.ts +68 -10
- package/src/adapters/venue-corpus/index.ts +28 -8
- package/src/cli-e2e.test.mjs +2 -2
- package/src/cli.test.ts +1 -1
- package/src/cli.ts +57 -13
- package/src/corpus-record-rule.test.ts +228 -0
- package/src/corpus-record-rule.ts +175 -0
- package/src/domain/corpus-record.test.ts +163 -0
- package/src/domain/corpus-record.ts +210 -0
- package/src/domain/venue-corpus.ts +32 -3
- package/src/paper-files.test.ts +13 -4
- package/src/paper-files.ts +23 -2
- package/src/paper-settings-commands.test.ts +2 -2
- package/src/papers-roots.test.ts +34 -1
- package/src/papers-roots.ts +15 -0
- package/src/rule-cases.test.ts +15 -0
- package/src/settled-paper.test.ts +1 -1
- package/src/unowned-file.test.ts +1 -1
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
import { NOASSERTION } from "../../domain/licence.ts";
|
|
14
|
-
import { type Copy, type Edition, type Licence, type ParsedCorpus, type Paper, type PaperIds, type VenueCorpus } from "../../domain/venue-corpus.ts";
|
|
14
|
+
import { type Copy, type Edition, type Licence, type ParsedCorpus, type Paper, type PaperIds, type StrongAcceptProxy, type VenueCorpus } from "../../domain/venue-corpus.ts";
|
|
15
15
|
import type { VenueCorpusCodec } from "../../ports/venue-corpus-codec.ts";
|
|
16
16
|
/** A licence: NOASSERTION alone, or any other id with where and when it was read. */
|
|
17
17
|
declare const licence: z.ZodPipe<z.ZodObject<{
|
|
@@ -184,11 +184,20 @@ declare const paper: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
184
184
|
}, z.core.$strict>;
|
|
185
185
|
}, z.core.$strict>], "version">>;
|
|
186
186
|
}, z.core.$loose>], "group">;
|
|
187
|
+
declare const proxy: z.ZodObject<{
|
|
188
|
+
what: z.ZodString;
|
|
189
|
+
papers: z.ZodNumber;
|
|
190
|
+
}, z.core.$strict>;
|
|
187
191
|
declare const edition: z.ZodObject<{
|
|
188
192
|
edition: z.ZodNumber;
|
|
189
193
|
listed_from: z.ZodURL;
|
|
190
194
|
read_on: z.ZodISODate;
|
|
191
195
|
accepted: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
capped: z.ZodNullable<z.ZodString>;
|
|
197
|
+
proxy: z.ZodNullable<z.ZodObject<{
|
|
198
|
+
what: z.ZodString;
|
|
199
|
+
papers: z.ZodNumber;
|
|
200
|
+
}, z.core.$strict>>;
|
|
192
201
|
}, z.core.$strict>;
|
|
193
202
|
declare const record: z.ZodObject<{
|
|
194
203
|
venue: z.ZodString;
|
|
@@ -197,6 +206,11 @@ declare const record: z.ZodObject<{
|
|
|
197
206
|
listed_from: z.ZodURL;
|
|
198
207
|
read_on: z.ZodISODate;
|
|
199
208
|
accepted: z.ZodOptional<z.ZodNumber>;
|
|
209
|
+
capped: z.ZodNullable<z.ZodString>;
|
|
210
|
+
proxy: z.ZodNullable<z.ZodObject<{
|
|
211
|
+
what: z.ZodString;
|
|
212
|
+
papers: z.ZodNumber;
|
|
213
|
+
}, z.core.$strict>>;
|
|
200
214
|
}, z.core.$strict>>;
|
|
201
215
|
papers: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
202
216
|
group: z.ZodEnum<{
|
|
@@ -308,6 +322,7 @@ declare const record: z.ZodObject<{
|
|
|
308
322
|
}, z.core.$strict>;
|
|
309
323
|
}, z.core.$strict>], "version">>;
|
|
310
324
|
}, z.core.$loose>], "group">>;
|
|
325
|
+
rebuild: z.ZodArray<z.ZodString>;
|
|
311
326
|
}, z.core.$strict>;
|
|
312
327
|
/** `T`, readonly all the way down: zod's outputs are mutable, the domain's are not. */
|
|
313
328
|
type Frozen<T> = T extends readonly (infer U)[] ? readonly Frozen<U>[] : T extends object ? {
|
|
@@ -319,6 +334,7 @@ type Same<A, B> = (<T>() => T extends Frozen<A> ? readonly [T] : 2) extends <T>(
|
|
|
319
334
|
export type SchemasAreTheDomain = [
|
|
320
335
|
Same<z.output<typeof record>, VenueCorpus>,
|
|
321
336
|
Same<z.output<typeof edition>, Edition>,
|
|
337
|
+
Same<z.output<typeof proxy>, StrongAcceptProxy>,
|
|
322
338
|
Same<z.output<typeof paper>, Paper>,
|
|
323
339
|
Same<z.output<typeof copy>, Copy>,
|
|
324
340
|
Same<z.output<typeof licence>, Licence>,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/venue-corpus/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,WAAW,EAEZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/venue-corpus/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,WAAW,EAEZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAIL,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,QAAQ,EAEb,KAAK,iBAAiB,EACtB,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAyB1E,qFAAqF;AACrF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;GAsBT,CAAC;AA2BL,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAgBR,CAAC;AAEH,QAAA,MAAM,GAAG;;;;;;kBAWN,CAAC;AAeJ,QAAA,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IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC/C,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,KAAK,CAAC,EAAE,KAAK,CAAC;IACnC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC;IACjC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,OAAO,CAAC,EAAE,OAAO,CAAC;IACvC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,EAAE,QAAQ,CAAC;CACrC,SAAS,IAAI,EAAE,GACZ,IAAI,GACJ,KAAK,CAAC;AAEV,iDAAiD;AACjD,eAAO,MAAM,sBAAsB,EAAE,mBAA0B,CAAC;AAuBhE,sGAAsG;AACtG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAQ3D;AAED,eAAO,MAAM,gBAAgB,EAAE,gBAA8C,CAAC;AAE9E,6GAA6G;AAC7G,eAAO,MAAM,WAAW,oDAAoD,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,QAAO,OAKvC,CAAC;AAEH,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,QAAO,MACgB,CAAC"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
import { isLicenceId, NOASSERTION, STORED_KINDS, } from "../../domain/licence.js";
|
|
14
|
-
import {
|
|
14
|
+
import { KEY_PATTERN, KNOWN_VERSIONS, PAPER_ID_KINDS, } from "../../domain/venue-corpus.js";
|
|
15
15
|
const words = z.string().min(1);
|
|
16
16
|
const date = z.iso.date();
|
|
17
17
|
/** Where a page or a file was read: a web address, never a local path or another scheme. */
|
|
@@ -123,11 +123,16 @@ const paper = z.discriminatedUnion("group", [
|
|
|
123
123
|
listed_from: webUrl,
|
|
124
124
|
}),
|
|
125
125
|
]);
|
|
126
|
+
const count = z.number().int().nonnegative();
|
|
127
|
+
const proxy = z.strictObject({ what: words, papers: count });
|
|
128
|
+
// `capped` and `proxy` are required, and "none" is null: a fact left out is not a fact recorded.
|
|
126
129
|
const edition = z.strictObject({
|
|
127
130
|
edition: year,
|
|
128
131
|
listed_from: webUrl,
|
|
129
132
|
read_on: date,
|
|
130
|
-
accepted:
|
|
133
|
+
accepted: count.optional(),
|
|
134
|
+
capped: words.nullable(),
|
|
135
|
+
proxy: proxy.nullable(),
|
|
131
136
|
});
|
|
132
137
|
/** Keys unique, editions unique, and every paper of this venue of a listed edition. */
|
|
133
138
|
const consistent = (r, ctx) => {
|
|
@@ -161,6 +166,7 @@ const record = z
|
|
|
161
166
|
venue: words,
|
|
162
167
|
editions: z.array(edition),
|
|
163
168
|
papers: z.array(paper),
|
|
169
|
+
rebuild: z.array(words),
|
|
164
170
|
})
|
|
165
171
|
.superRefine(consistent);
|
|
166
172
|
/** The proof is used, so the build checks it. */
|
|
@@ -174,16 +180,26 @@ function jsonOf(text) {
|
|
|
174
180
|
return undefined;
|
|
175
181
|
}
|
|
176
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* One zod issue as a problem. A misspelt key's path ends at the key (the first, when there are
|
|
185
|
+
* several), so a reader of the file lands on it rather than on the object holding it.
|
|
186
|
+
*/
|
|
187
|
+
const problemOf = (i) => ({
|
|
188
|
+
path: [
|
|
189
|
+
...i.path.filter((s) => typeof s !== "symbol"),
|
|
190
|
+
...(i.code === "unrecognized_keys" ? i.keys.slice(0, 1) : []),
|
|
191
|
+
],
|
|
192
|
+
message: i.message,
|
|
193
|
+
});
|
|
177
194
|
/** A `papers.json`'s text, parsed once at the boundary: the record, or every reason it is not one. */
|
|
178
195
|
export function parseVenueCorpus(text) {
|
|
179
196
|
const json = jsonOf(text);
|
|
180
197
|
if (json === undefined)
|
|
181
|
-
return { ok: false,
|
|
198
|
+
return { ok: false, problems: [{ path: [], message: "not JSON" }] };
|
|
182
199
|
const parsed = record.safeParse(json);
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return { ok: false, why: `${CORPUS_RECORD}: ${reasons.join("; ")}` };
|
|
200
|
+
return parsed.success
|
|
201
|
+
? { ok: true, corpus: parsed.data }
|
|
202
|
+
: { ok: false, problems: parsed.error.issues.map(problemOf) };
|
|
187
203
|
}
|
|
188
204
|
export const venueCorpusCodec = { parse: parseVenueCorpus };
|
|
189
205
|
/** Where the shipped JSON Schema of the record sits, below the package root: in the skill that writes it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/venue-corpus/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/venue-corpus/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,GAUf,MAAM,8BAA8B,CAAC;AAGtC,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;AAC1B,4FAA4F;AAC5F,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC;IACnB,QAAQ,EAAE,WAAW;IACrB,KAAK,EAAE,0BAA0B;CAClC,CAAC,CAAC;AAEH,4FAA4F;AAC5F,MAAM,OAAO,GAAG,CACd,MAA0B,EACc,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OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;IACtE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,OAAO;QACnB,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE;QACnC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;AAClE,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAqB,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;AAE9E,6GAA6G;AAC7G,MAAM,CAAC,MAAM,WAAW,GAAG,iDAAiD,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAY,EAAE,CAAC,CAAC;IACnD,GAAG,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;IAClE,KAAK,EAAE,8BAA8B;IACrC,WAAW,EACT,4ZAA4Z;CAC/Z,CAAC,CAAC;AAEH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAW,EAAE,CAChD,GAAG,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -47,7 +47,8 @@ export declare function buildConfig(opts: PaperlintConfig | undefined, texLangua
|
|
|
47
47
|
export declare function eslintConfig(blocks: readonly ConfigBlock[]): Linter.Config[];
|
|
48
48
|
/**
|
|
49
49
|
* The rule ids a consumer may name in `rules`: every rule paperlint's own config defines, read off that
|
|
50
|
-
* config rather than listed again. `@eslint/markdown`
|
|
50
|
+
* config rather than listed again. `@eslint/markdown` and `@eslint/json` are a dependency's plugins,
|
|
51
|
+
* not paperlint's.
|
|
51
52
|
*/
|
|
52
53
|
export declare const SHIPPED_RULES: ReadonlySet<string>;
|
|
53
54
|
/** A plugin as `rulePlugins` gives it: its rules, and for `tex` the LaTeX language when given. */
|
|
@@ -59,7 +60,7 @@ export interface RulePlugin {
|
|
|
59
60
|
* Every plugin paperlint's config registers, ONE object per name, read off that config. In it one
|
|
60
61
|
* name is bound to different objects in different blocks (`paper` beside `PIPELINE-STATUS.md` is
|
|
61
62
|
* not `paper` beside `paper.tex`); here their rules are merged, so a config that lints any paper
|
|
62
|
-
* file knows every rule id. `@eslint/markdown`
|
|
63
|
+
* file knows every rule id. `@eslint/markdown` and `@eslint/json` are a dependency's plugins and are left out. The LaTeX
|
|
63
64
|
* language rides on `tex` when `texLanguage` is given, and that is how a consumer registers it: a
|
|
64
65
|
* second `tex` plugin of its own is refused by ESLint ("Cannot redefine plugin "tex"", measured
|
|
65
66
|
* with and without the language here). Without it, `tex` carries rules only.
|
|
@@ -89,7 +90,7 @@ export declare function silentOptionalRules(eslint: Pick<ESLint, "calculateConfi
|
|
|
89
90
|
* them. A file that does not parse, or names a rule paperlint does not ship, stops the run with one
|
|
90
91
|
* line naming the file — the same strictness as the root's own `rules`.
|
|
91
92
|
*/
|
|
92
|
-
export declare function paperRuleBlocks(paths: readonly string[]): Parsed<PaperBlocks>;
|
|
93
|
+
export declare function paperRuleBlocks(paths: readonly string[], roots: readonly string[]): Parsed<PaperBlocks>;
|
|
93
94
|
/** One paper's blocks, in the order `lint` applies them around the root's (most general first). */
|
|
94
95
|
interface PaperBlocks {
|
|
95
96
|
readonly preset: readonly RuleBlock[];
|
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,EAA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AC,CAAC,KACnD,IAAI,CAAC;AAgBV,wBAAsB,GAAG,CACvB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EACE,GAAiB,EACjB,GAAmB,EACnB,GAAmB,EACnB,GAA6B,EAC7B,eAAkC,EAClC,eAAmC,EACnC,UAA2B,EAC3B,OAAwB,EACxB,MAAqB,EACrB,aAAa,GACd,GAAE;IACD,GAAG,CAAC,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC;IACzB,GAAG,CAAC,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mGAAmG;IACnG,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,wGAAwG;IACxG,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,uGAAuG;IACvG,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,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
|
@@ -30,6 +30,7 @@ import { isOk } from "./domain/result.js";
|
|
|
30
30
|
import { stripVTControlCharacters } from "node:util";
|
|
31
31
|
import { fileURLToPath } from "node:url";
|
|
32
32
|
import { join, dirname, resolve, relative, basename, sep } from "node:path";
|
|
33
|
+
import json from "@eslint/json";
|
|
33
34
|
import markdown from "@eslint/markdown";
|
|
34
35
|
import { z } from "zod";
|
|
35
36
|
// Types come from consumer.d.mts beside it.
|
|
@@ -74,7 +75,7 @@ import { hotcrpSite } from "./adapters/hotcrp/index.js";
|
|
|
74
75
|
import { runSubmission, submissionSections } from "./submission.js";
|
|
75
76
|
import { LINT_FORMAT, isEmptyLintSet, lintExitCode, lintResultFor, lintText, printLintResults, submissionLinter, } from "./adapters/eslint/index.js";
|
|
76
77
|
export { lintText } from "./adapters/eslint/index.js";
|
|
77
|
-
import { ANY_PAPER, narrowToOwners, ownedPatterns, paperFiles, papersScope, ruleOwners, scopeToOwned, } from "./paper-files.js";
|
|
78
|
+
import { ANY_PAPER, corpusFiles, narrowToOwners, ownedPatterns, paperFiles, papersScope, ruleOwners, scopeToOwned, } from "./paper-files.js";
|
|
78
79
|
import { stageBlocks } from "./settled-paper.js";
|
|
79
80
|
import { paperPreset, settingsProblemLine, presetProblemText, resolvePreset, resolveShipped, bareSeriesText, shippedPresets, shippedSpec, shippedFolderNames, SHIPPED_PREFIX, } from "./presets.js";
|
|
80
81
|
import { mergeRequirements, declaredUnion, requirementsFor, NO_REQUIREMENTS, } from "./tex-requirements.js";
|
|
@@ -106,7 +107,10 @@ import { DRAFT_RULE_LEVELS, draftRules, submittedFrozenRules, VERSION_STATUS_RUL
|
|
|
106
107
|
import { FOLDER_VENUE_RULE_LEVELS, folderVenueRules, } from "./folder-venue-rule.js";
|
|
107
108
|
import { FOLDER_LAYOUT_RULE_LEVELS, folderLayoutRules, } from "./folder-layout-rule.js";
|
|
108
109
|
import { folderLayoutHook } from "./folder-layout-hook.js";
|
|
109
|
-
import { papersDirOf, papersRoots, toPaths } from "./papers-roots.js";
|
|
110
|
+
import { inCorpus, papersDirOf, papersRoots, toPaths } from "./papers-roots.js";
|
|
111
|
+
import { CORPUS_RECORD_RULE_LEVELS, corpusRecordRules, } from "./corpus-record-rule.js";
|
|
112
|
+
import { CORPUS_RECORD } from "./domain/venue-corpus.js";
|
|
113
|
+
import { venueCorpusCodec } from "./adapters/venue-corpus/index.js";
|
|
110
114
|
import { paperFolderOf, writtenPath } from "./domain/paper-folder.js";
|
|
111
115
|
import { papersReached } from "./domain/paper-dirs.js";
|
|
112
116
|
import { NOTICE_HOOKS, collector, lintLine, mergeNotice, noticeText, notYetTold, recordTold, hookNotRunningText, } from "./hooks-notice.js";
|
|
@@ -446,6 +450,25 @@ const TALK_RULE_DEPS = {
|
|
|
446
450
|
media: { probeVideo, imageSize, captions },
|
|
447
451
|
listDir: nodeListDir,
|
|
448
452
|
};
|
|
453
|
+
/**
|
|
454
|
+
* A venue corpus, `<papers-root>/venues/<venue>/`, reached through its `papers.json`, linted with
|
|
455
|
+
* ESLint's JSON language so `corpus/record` reports at the field (docs/design/venue-corpus.md,
|
|
456
|
+
* decision 4). The JSON language reaches no other file: this block alone names it.
|
|
457
|
+
*/
|
|
458
|
+
const corpusBlock = (papers) => ({
|
|
459
|
+
files: corpusFiles(papers, CORPUS_RECORD),
|
|
460
|
+
plugins: {
|
|
461
|
+
json,
|
|
462
|
+
corpus: {
|
|
463
|
+
rules: corpusRecordRules({
|
|
464
|
+
entries: nodeListEntries,
|
|
465
|
+
codec: venueCorpusCodec,
|
|
466
|
+
}),
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
language: "json/json",
|
|
470
|
+
rules: CORPUS_RECORD_RULE_LEVELS,
|
|
471
|
+
});
|
|
449
472
|
/** The config the user would otherwise write by hand. The data comes from `opts`, the mechanism is here. */
|
|
450
473
|
export function buildConfig(opts = {}, texLanguage,
|
|
451
474
|
// The papers whose own files the blocks claim (`PaperScope`): any folder for the config's shape,
|
|
@@ -527,6 +550,7 @@ papers = ANY_PAPER) {
|
|
|
527
550
|
...STATUS_CYCLE_RULE_LEVELS,
|
|
528
551
|
},
|
|
529
552
|
},
|
|
553
|
+
corpusBlock(papers),
|
|
530
554
|
{
|
|
531
555
|
files: own("reviews/*.md"),
|
|
532
556
|
plugins: { markdown, review: reviewFrontmatter },
|
|
@@ -650,14 +674,15 @@ export function eslintConfig(blocks) {
|
|
|
650
674
|
}
|
|
651
675
|
/**
|
|
652
676
|
* The rule ids a consumer may name in `rules`: every rule paperlint's own config defines, read off that
|
|
653
|
-
* config rather than listed again. `@eslint/markdown`
|
|
677
|
+
* config rather than listed again. `@eslint/markdown` and `@eslint/json` are a dependency's plugins,
|
|
678
|
+
* not paperlint's.
|
|
654
679
|
*/
|
|
655
|
-
export const SHIPPED_RULES = shippedRuleIds(buildConfig({}, { sentinel: "tex language" }), [markdown]);
|
|
680
|
+
export const SHIPPED_RULES = shippedRuleIds(buildConfig({}, { sentinel: "tex language" }), [markdown, json]);
|
|
656
681
|
/**
|
|
657
682
|
* Every plugin paperlint's config registers, ONE object per name, read off that config. In it one
|
|
658
683
|
* name is bound to different objects in different blocks (`paper` beside `PIPELINE-STATUS.md` is
|
|
659
684
|
* not `paper` beside `paper.tex`); here their rules are merged, so a config that lints any paper
|
|
660
|
-
* file knows every rule id. `@eslint/markdown`
|
|
685
|
+
* file knows every rule id. `@eslint/markdown` and `@eslint/json` are a dependency's plugins and are left out. The LaTeX
|
|
661
686
|
* language rides on `tex` when `texLanguage` is given, and that is how a consumer registers it: a
|
|
662
687
|
* second `tex` plugin of its own is refused by ESLint ("Cannot redefine plugin "tex"", measured
|
|
663
688
|
* with and without the language here). Without it, `tex` carries rules only.
|
|
@@ -666,7 +691,7 @@ export function rulePlugins(texLanguage) {
|
|
|
666
691
|
const out = {};
|
|
667
692
|
for (const block of buildConfig({}, texLanguage ?? { sentinel: "tex" }))
|
|
668
693
|
for (const [name, plugin] of Object.entries(block.plugins ?? {}))
|
|
669
|
-
if (plugin !== markdown)
|
|
694
|
+
if (plugin !== markdown && plugin !== json)
|
|
670
695
|
out[name] = { rules: { ...out[name]?.rules, ...plugin.rules } };
|
|
671
696
|
if (out["tex"] && texLanguage !== undefined)
|
|
672
697
|
return {
|
|
@@ -776,16 +801,19 @@ const PAPER_TREE = {
|
|
|
776
801
|
}
|
|
777
802
|
},
|
|
778
803
|
};
|
|
779
|
-
/**
|
|
780
|
-
|
|
804
|
+
/**
|
|
805
|
+
* The papers `paths` reach: a file counts as the folder it sits in (#582). A folder in a venue corpus
|
|
806
|
+
* of `roots` is none of them (#215): a `paper.tex` kept there is an accepted paper's source.
|
|
807
|
+
*/
|
|
808
|
+
const paperDirs = (paths, roots) => papersReached(paths.map((p) => resolve(existsSync(p) && statSync(p).isFile() ? dirname(p) : p)), PAPER_TREE).filter((d) => !inCorpus(d, roots));
|
|
781
809
|
/**
|
|
782
810
|
* Every linted paper's rules, as ESLint blocks scoped to that paper, in two groups: what its venue
|
|
783
811
|
* preset turns on, and what its own `paperlint.json` says. The caller puts the root's blocks between
|
|
784
812
|
* them. A file that does not parse, or names a rule paperlint does not ship, stops the run with one
|
|
785
813
|
* line naming the file — the same strictness as the root's own `rules`.
|
|
786
814
|
*/
|
|
787
|
-
export function paperRuleBlocks(paths) {
|
|
788
|
-
const each = paperDirs(paths).map((dir) => {
|
|
815
|
+
export function paperRuleBlocks(paths, roots) {
|
|
816
|
+
const each = paperDirs(paths, roots).map((dir) => {
|
|
789
817
|
const p = paperPreset(dir, PRESET_DEPS);
|
|
790
818
|
return p.kind === "settings-problem"
|
|
791
819
|
? { ok: false, error: settingsProblemLine(dir, p.problem) }
|
|
@@ -2028,7 +2056,8 @@ async function paperEslint(cfg, paths, { loadTexLanguage, fix, stats, }) {
|
|
|
2028
2056
|
// paper's venue preset → the root paperlint.json → the paper's own paperlint.json → the paper's
|
|
2029
2057
|
// stage (src/settled-paper.ts), last because a published text has nothing left to fix whoever
|
|
2030
2058
|
// turned a writing rule on.
|
|
2031
|
-
const
|
|
2059
|
+
const roots = papersRoots(cfg);
|
|
2060
|
+
const papers = paperRuleBlocks(paths, roots);
|
|
2032
2061
|
if (!papers.ok)
|
|
2033
2062
|
return papers;
|
|
2034
2063
|
const opts = {
|
|
@@ -2048,13 +2077,13 @@ async function paperEslint(cfg, paths, { loadTexLanguage, fix, stats, }) {
|
|
|
2048
2077
|
// loaded, since only its rules read them. The project's papers too: `paperlint lint .` reaches
|
|
2049
2078
|
// papers two levels down, which a directory's immediate papers do not.
|
|
2050
2079
|
const bodies = texLanguage
|
|
2051
|
-
? paperBodies(paperDirs([...paths, ...
|
|
2080
|
+
? paperBodies(paperDirs([...paths, ...roots], roots), RECORD_DEPS)
|
|
2052
2081
|
: [];
|
|
2053
2082
|
const cwd = lintRoot(cfg.root, paths);
|
|
2054
2083
|
// The papers whose own files the config names: the ones `paths` reach and the project's. A copy of
|
|
2055
2084
|
// a paper kept inside it (a review snapshot, a build copy) is in no such list, so no block claims
|
|
2056
2085
|
// it (#582).
|
|
2057
|
-
const claimed = papersScope(paperDirs([...paths, ...
|
|
2086
|
+
const claimed = papersScope(paperDirs([...paths, ...roots], roots), cwd, roots);
|
|
2058
2087
|
const eslint = new ESLint({
|
|
2059
2088
|
cwd,
|
|
2060
2089
|
overrideConfigFile: true,
|