paperlint 18.1.0 → 18.2.1
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/README.md +2 -2
- package/dist/adapters/latex/document-class.d.ts +28 -5
- package/dist/adapters/latex/document-class.d.ts.map +1 -1
- package/dist/adapters/latex/document-class.js +208 -21
- package/dist/adapters/latex/document-class.js.map +1 -1
- package/dist/adapters/latex/index.d.ts +4 -4
- package/dist/adapters/latex/index.d.ts.map +1 -1
- package/dist/adapters/latex/index.js +5 -2
- package/dist/adapters/latex/index.js.map +1 -1
- package/dist/adapters/latex/parse.d.ts.map +1 -1
- package/dist/adapters/latex/parse.js +5 -0
- package/dist/adapters/latex/parse.js.map +1 -1
- package/dist/adapters/latex/prose.d.ts.map +1 -1
- package/dist/adapters/latex/prose.js +20 -4
- package/dist/adapters/latex/prose.js.map +1 -1
- package/dist/domain/body-pages.d.ts.map +1 -1
- package/dist/domain/body-pages.js +4 -2
- package/dist/domain/body-pages.js.map +1 -1
- package/dist/domain/tex-document.d.ts +52 -4
- package/dist/domain/tex-document.d.ts.map +1 -1
- package/dist/domain/tex-document.js +9 -0
- package/dist/domain/tex-document.js.map +1 -1
- package/dist/eslint-rules/latex-language.d.ts +10 -0
- package/dist/eslint-rules/latex-language.d.ts.map +1 -1
- package/dist/eslint-rules/latex-language.js +41 -2
- package/dist/eslint-rules/latex-language.js.map +1 -1
- package/dist/ports/latex.d.ts +13 -1
- package/dist/ports/latex.d.ts.map +1 -1
- package/dist/presets.d.ts +15 -0
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +9 -0
- package/dist/presets.js.map +1 -1
- package/dist/tex-requirements.d.ts +2 -0
- package/dist/tex-requirements.d.ts.map +1 -1
- package/dist/tex-requirements.js +7 -2
- package/dist/tex-requirements.js.map +1 -1
- package/dist/tex-venue-rules.d.ts +36 -3
- package/dist/tex-venue-rules.d.ts.map +1 -1
- package/dist/tex-venue-rules.js +181 -33
- package/dist/tex-venue-rules.js.map +1 -1
- package/docs/rules/cycle/port-done.md +3 -0
- package/docs/rules/tex/negated-sentences.md +1 -1
- package/docs/rules/tex/template.md +96 -1
- package/docs/rules.md +19 -14
- package/docs/venues.md +51 -12
- package/eslint-rules/latex-language.test.mjs +64 -1
- package/eslint-rules/latex-language.ts +44 -2
- package/eslint.config.mjs +1 -0
- package/fixtures/build-e2e/neurips/PIPELINE-STATUS.md +3 -0
- package/fixtures/build-e2e/neurips/expect.json +20 -0
- package/fixtures/build-e2e/neurips/paper.tex +60 -0
- package/fixtures/build-e2e/neurips/paperlint.json +1 -0
- package/fixtures/build-e2e/neurips-nostyle/PIPELINE-STATUS.md +3 -0
- package/fixtures/build-e2e/neurips-nostyle/expect.json +26 -0
- package/fixtures/build-e2e/neurips-nostyle/paper.tex +56 -0
- package/fixtures/build-e2e/neurips-nostyle/paperlint.json +1 -0
- package/fixtures/build-e2e/neurips-over/PIPELINE-STATUS.md +3 -0
- package/fixtures/build-e2e/neurips-over/expect.json +24 -0
- package/fixtures/build-e2e/neurips-over/paper.tex +56 -0
- package/fixtures/build-e2e/neurips-over/paperlint.json +1 -0
- package/fixtures/real-papers.test.ts +17 -6
- package/package.json +3 -1
- package/presets/aaai-2027.jsonc +126 -0
- package/presets/aaai-2027.md +127 -0
- package/presets/aaai-press.jsonc +167 -0
- package/presets/aaai-press.md +126 -0
- package/presets/aidc-2026.jsonc +11 -11
- package/presets/icml-2027.jsonc +111 -0
- package/presets/icml-2027.md +130 -0
- package/presets/icml-style.jsonc +125 -0
- package/presets/icml-style.md +77 -0
- package/presets/neurips-2026.jsonc +123 -0
- package/presets/neurips-2026.md +137 -0
- package/presets/neurips-style.jsonc +113 -0
- package/presets/neurips-style.md +85 -0
- package/presets/venue-profile.schema.json +6 -0
- package/skills/build-label-page/scripts/label-page-browser.test.ts +275 -114
- package/src/adapters/latex/document-class.ts +292 -20
- package/src/adapters/latex/index.test.ts +310 -0
- package/src/adapters/latex/index.ts +12 -3
- package/src/adapters/latex/parse.ts +5 -0
- package/src/adapters/latex/prose.ts +27 -4
- package/src/cli.test.ts +6 -1
- package/src/domain/body-pages.test.ts +22 -6
- package/src/domain/body-pages.ts +4 -2
- package/src/domain/tex-document.ts +64 -5
- package/src/folder-venue-rule.test.ts +51 -0
- package/src/new-paper.test.ts +2 -2
- package/src/paper-settings-commands.test.ts +1 -1
- package/src/ports/latex.ts +14 -0
- package/src/preset-card-rule.test.ts +44 -27
- package/src/presets.test.ts +177 -1
- package/src/presets.ts +27 -0
- package/src/register-bands.test.ts +2 -2
- package/src/rule-cases.test.ts +52 -0
- package/src/tex-requirements.harness.ts +17 -3
- package/src/tex-requirements.ts +13 -2
- package/src/tex-venue-rules.test.ts +1020 -0
- package/src/tex-venue-rules.ts +248 -38
- package/src/venue-rules.test.ts +369 -2
|
@@ -14,7 +14,9 @@ import {
|
|
|
14
14
|
cyclePortRules,
|
|
15
15
|
judgeRequiredSections,
|
|
16
16
|
judgeLeftover,
|
|
17
|
+
judgeStyle,
|
|
17
18
|
judgeTemplate,
|
|
19
|
+
otherStyles,
|
|
18
20
|
otherVenues,
|
|
19
21
|
FORMAT_RULE_LEVELS,
|
|
20
22
|
formatRules,
|
|
@@ -307,6 +309,250 @@ describe("tex/template — several \\documentclass lines behind a TeX switch", (
|
|
|
307
309
|
});
|
|
308
310
|
});
|
|
309
311
|
|
|
312
|
+
const MSR = { extends: "paperlint:msr-2027", kind: "technical" };
|
|
313
|
+
|
|
314
|
+
describe("tex/template — options passed before the class line (`\\PassOptionsToClass`)", () => {
|
|
315
|
+
it("🔴 an option passed to the class before \\documentclass is in effect: no missing-option finding", () => {
|
|
316
|
+
expect(
|
|
317
|
+
lint(
|
|
318
|
+
paper(
|
|
319
|
+
"\\PassOptionsToClass{compsoc}{IEEEtran}\n\\documentclass[conference]{IEEEtran}",
|
|
320
|
+
),
|
|
321
|
+
AIDC,
|
|
322
|
+
),
|
|
323
|
+
).toEqual([]);
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
it("several options in one call, spaces and all, and a class line with no options of its own", () => {
|
|
327
|
+
expect(
|
|
328
|
+
lint(
|
|
329
|
+
paper(
|
|
330
|
+
"\\PassOptionsToClass{ conference , compsoc }{ IEEEtran }\n\\documentclass{IEEEtran}",
|
|
331
|
+
),
|
|
332
|
+
AIDC,
|
|
333
|
+
),
|
|
334
|
+
).toEqual([]);
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
it("🔴 a forbidden option passed before the class line is reported where it is passed", () => {
|
|
338
|
+
const fs = lint(
|
|
339
|
+
paper(
|
|
340
|
+
"\\PassOptionsToClass{compsoc}{IEEEtran}\n\\documentclass[10pt,conference]{IEEEtran}",
|
|
341
|
+
"Text.",
|
|
342
|
+
),
|
|
343
|
+
MSR,
|
|
344
|
+
);
|
|
345
|
+
expect(ids(fs)).toEqual(["tex/template:forbiddenOption"]);
|
|
346
|
+
expect(fs[0]?.message).toBe(
|
|
347
|
+
"the class option `compsoc` is forbidden: MSR requires `\\documentclass[10pt,conference]{IEEEtran}` without `compsoc`, `compsocconf`",
|
|
348
|
+
);
|
|
349
|
+
expect(fs[0]?.line).toBe(2);
|
|
350
|
+
});
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
describe("tex/template — `\\PassOptionsToClass` counts only before the line, for its class", () => {
|
|
354
|
+
it("options passed to another class, or after the class line, are not in effect", () => {
|
|
355
|
+
expect(
|
|
356
|
+
ids(
|
|
357
|
+
lint(
|
|
358
|
+
paper(
|
|
359
|
+
"\\PassOptionsToClass{compsoc}{article}\n\\documentclass[conference]{IEEEtran}",
|
|
360
|
+
),
|
|
361
|
+
AIDC,
|
|
362
|
+
),
|
|
363
|
+
),
|
|
364
|
+
).toEqual(["tex/template:missingOption"]);
|
|
365
|
+
expect(
|
|
366
|
+
ids(
|
|
367
|
+
lint(
|
|
368
|
+
paper(
|
|
369
|
+
"\\documentclass[conference]{IEEEtran}\n\\PassOptionsToClass{compsoc}{IEEEtran}",
|
|
370
|
+
),
|
|
371
|
+
AIDC,
|
|
372
|
+
),
|
|
373
|
+
),
|
|
374
|
+
).toEqual(["tex/template:missingOption"]);
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
it("behind a TeX switch, an option passed before a candidate counts for it", () => {
|
|
378
|
+
expect(
|
|
379
|
+
lint(
|
|
380
|
+
paper(
|
|
381
|
+
"\\PassOptionsToClass{compsoc}{IEEEtran}\n\\if\\v1 \\documentclass{article} \\fi\n\\if\\v2 \\documentclass[conference]{IEEEtran} \\fi",
|
|
382
|
+
),
|
|
383
|
+
AIDC,
|
|
384
|
+
),
|
|
385
|
+
).toEqual([]);
|
|
386
|
+
});
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
describe("tex/template — a class line built by a macro is not read, and not reported", () => {
|
|
390
|
+
it("🔴 options from a macro: no missing-option finding", () => {
|
|
391
|
+
expect(
|
|
392
|
+
lint(
|
|
393
|
+
paper(
|
|
394
|
+
"\\newcommand{\\opts}{conference,compsoc}\n\\documentclass[\\opts]{IEEEtran}",
|
|
395
|
+
),
|
|
396
|
+
AIDC,
|
|
397
|
+
),
|
|
398
|
+
).toEqual([]);
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
it("🔴 one option from a macro beside literal ones: no missing-option finding", () => {
|
|
402
|
+
expect(
|
|
403
|
+
lint(
|
|
404
|
+
paper(
|
|
405
|
+
"\\def\\venuemode{conference}\n\\documentclass[\\venuemode,compsoc]{IEEEtran}",
|
|
406
|
+
),
|
|
407
|
+
AIDC,
|
|
408
|
+
),
|
|
409
|
+
).toEqual([]);
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
it("a literal forbidden option beside a macro is still reported: it is in effect whatever the macro holds", () => {
|
|
413
|
+
expect(
|
|
414
|
+
ids(
|
|
415
|
+
lint(
|
|
416
|
+
paper(
|
|
417
|
+
"\\def\\venuemode{conference}\n\\documentclass[10pt,\\venuemode,compsoc]{IEEEtran}",
|
|
418
|
+
"Text.",
|
|
419
|
+
),
|
|
420
|
+
MSR,
|
|
421
|
+
),
|
|
422
|
+
),
|
|
423
|
+
).toEqual(["tex/template:forbiddenOption"]);
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
describe("tex/template — a class name built by a macro, and a class line out of reach", () => {
|
|
428
|
+
it("🔴 the class name from a macro: no finding", () => {
|
|
429
|
+
expect(
|
|
430
|
+
lint(
|
|
431
|
+
paper(
|
|
432
|
+
"\\def\\cls{IEEEtran}\n\\documentclass[conference,compsoc]{\\cls}",
|
|
433
|
+
),
|
|
434
|
+
AIDC,
|
|
435
|
+
),
|
|
436
|
+
).toEqual([]);
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
it("behind a TeX switch, a candidate built by a macro may be the venue's: no finding", () => {
|
|
440
|
+
expect(
|
|
441
|
+
lint(
|
|
442
|
+
paper(
|
|
443
|
+
"\\if\\v1 \\documentclass{article} \\fi\n\\if\\v2 \\documentclass[\\opts]{IEEEtran} \\fi",
|
|
444
|
+
),
|
|
445
|
+
AIDC,
|
|
446
|
+
),
|
|
447
|
+
).toEqual([]);
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
it("the other half: an option that is no macro, beside the venue's class, still fires", () => {
|
|
451
|
+
expect(
|
|
452
|
+
ids(lint(paper("\\documentclass[conference,a4paper]{IEEEtran}"), AIDC)),
|
|
453
|
+
).toEqual(["tex/template:missingOption"]);
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
it("🔴 a \\documentclass the parser reads as another macro's argument is not called missing", () => {
|
|
457
|
+
// unified-latex knows `\mode` (beamer's, with an argument), so `\def` takes the class line as
|
|
458
|
+
// its body: the line is in the tree, not at its top.
|
|
459
|
+
expect(
|
|
460
|
+
lint(
|
|
461
|
+
paper(
|
|
462
|
+
"\\def\\mode{conference}\n\\documentclass[conference,compsoc]{IEEEtran}",
|
|
463
|
+
),
|
|
464
|
+
AIDC,
|
|
465
|
+
),
|
|
466
|
+
).toEqual([]);
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
describe("tex/template — a \\documentclass TeX never reads", () => {
|
|
471
|
+
it("in a verbatim block or a filecontents block: not the paper's class", () => {
|
|
472
|
+
const body =
|
|
473
|
+
"\\begin{verbatim}\n\\documentclass{article}\n\\end{verbatim}\n\\section*{LLM Usage Statement}\nNone.";
|
|
474
|
+
expect(
|
|
475
|
+
lint(paper("\\documentclass[conference,compsoc]{IEEEtran}", body), AIDC),
|
|
476
|
+
).toEqual([]);
|
|
477
|
+
expect(
|
|
478
|
+
lint(
|
|
479
|
+
paper(
|
|
480
|
+
"\\begin{filecontents*}{old.tex}\n\\documentclass{article}\n\\end{filecontents*}\n\\documentclass[conference,compsoc]{IEEEtran}",
|
|
481
|
+
),
|
|
482
|
+
AIDC,
|
|
483
|
+
),
|
|
484
|
+
).toEqual([]);
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
it("behind \\iffalse … \\fi: not a candidate — the live line alone is judged", () => {
|
|
488
|
+
expect(
|
|
489
|
+
lint(
|
|
490
|
+
paper(
|
|
491
|
+
"\\iffalse\n\\documentclass{article}\n\\fi\n\\documentclass[conference,compsoc]{IEEEtran}",
|
|
492
|
+
),
|
|
493
|
+
AIDC,
|
|
494
|
+
),
|
|
495
|
+
).toEqual([]);
|
|
496
|
+
// The other half: the venue's line behind \iffalse does not rescue a wrong live line.
|
|
497
|
+
const fs = lint(
|
|
498
|
+
paper(
|
|
499
|
+
"\\iffalse\n\\documentclass[conference,compsoc]{IEEEtran}\n\\fi\n\\documentclass[conference]{IEEEtran}",
|
|
500
|
+
),
|
|
501
|
+
AIDC,
|
|
502
|
+
);
|
|
503
|
+
expect(ids(fs)).toEqual(["tex/template:missingOption"]);
|
|
504
|
+
expect(fs[0]?.line).toBe(5);
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
it("a release date after the class name is not part of it", () => {
|
|
508
|
+
expect(
|
|
509
|
+
lint(
|
|
510
|
+
paper("\\documentclass[conference,compsoc]{IEEEtran}[2015/08/26]"),
|
|
511
|
+
AIDC,
|
|
512
|
+
),
|
|
513
|
+
).toEqual([]);
|
|
514
|
+
});
|
|
515
|
+
});
|
|
516
|
+
|
|
517
|
+
describe("tex/template — the class line kept in a file paper.tex \\inputs", () => {
|
|
518
|
+
const tex =
|
|
519
|
+
"\\input{preamble}\n\\begin{document}\nText.\n\\section*{LLM Usage Statement}\nNone.\n\\end{document}\n";
|
|
520
|
+
|
|
521
|
+
it("with the build's record, the included class line is judged, both halves", () => {
|
|
522
|
+
const built = (cls: string) =>
|
|
523
|
+
builtPaper(PAPER, { "paper.tex": tex, "preamble.tex": `${cls}\n` }, [
|
|
524
|
+
{ path: "paper.tex", role: "body" },
|
|
525
|
+
{ path: "preamble.tex", role: "preamble" },
|
|
526
|
+
]);
|
|
527
|
+
expect(
|
|
528
|
+
lint(tex, AIDC, {
|
|
529
|
+
extra: built("\\documentclass[conference,compsoc]{IEEEtran}"),
|
|
530
|
+
}),
|
|
531
|
+
).toEqual([]);
|
|
532
|
+
// A finding in an included file arrives as a whole message, at the \input, its file in front.
|
|
533
|
+
const fs = lint(tex, AIDC, {
|
|
534
|
+
extra: built("\\documentclass[conference]{IEEEtran}"),
|
|
535
|
+
});
|
|
536
|
+
expect(fs.map((f) => [f.rule, f.line, f.message])).toEqual([
|
|
537
|
+
[
|
|
538
|
+
"tex/template",
|
|
539
|
+
1,
|
|
540
|
+
"preamble.tex:1:1: the class option `compsoc` is missing: AIDC requires `\\documentclass[conference,compsoc]{IEEEtran}`",
|
|
541
|
+
],
|
|
542
|
+
]);
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
it("🔴 with no record yet, a paper.tex that \\inputs its preamble is not said to have no class", () => {
|
|
546
|
+
expect(lint(tex, AIDC)).toEqual([]);
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
it("an \\input only in the body does not hide a missing class", () => {
|
|
550
|
+
const bodyOnly =
|
|
551
|
+
"\\begin{document}\n\\input{intro}\n\\section*{LLM Usage Statement}\nNone.\n\\end{document}\n";
|
|
552
|
+
expect(ids(lint(bodyOnly, AIDC))).toEqual(["tex/template:noClass"]);
|
|
553
|
+
});
|
|
554
|
+
});
|
|
555
|
+
|
|
310
556
|
describe("tex/template — the shipped ACM and ACL templates", () => {
|
|
311
557
|
it("🔴 acmart without sigconf — the manuscript format — fails every ACM preset", () => {
|
|
312
558
|
for (const settings of [
|
|
@@ -398,7 +644,54 @@ describe("cycle/port-done — the declared port is finished", () => {
|
|
|
398
644
|
).toEqual([]);
|
|
399
645
|
expect(lint(OFFICIAL, AIDC)).toEqual([]);
|
|
400
646
|
});
|
|
647
|
+
});
|
|
401
648
|
|
|
649
|
+
describe("cycle/port-done — only a class line read whole ends the port", () => {
|
|
650
|
+
it("🔴 silent on a class line it cannot read: a line built by a macro is not known to be the venue's", () => {
|
|
651
|
+
const porting = (cls: string) =>
|
|
652
|
+
lint(paper(cls), { cycles: [PORTING] }).filter(
|
|
653
|
+
(f) => f.rule === "cycle/port-done",
|
|
654
|
+
);
|
|
655
|
+
expect(porting("\\documentclass[\\opts]{IEEEtran}")).toEqual([]);
|
|
656
|
+
expect(porting("\\documentclass[conference,compsoc]{\\cls}")).toEqual([]);
|
|
657
|
+
expect(porting("\\input{preamble}")).toEqual([]);
|
|
658
|
+
});
|
|
659
|
+
|
|
660
|
+
it("an option passed with \\PassOptionsToClass completes the venue's line; one candidate of a switch is enough", () => {
|
|
661
|
+
const done = (cls: string) => ids(lint(paper(cls), { cycles: [PORTING] }));
|
|
662
|
+
expect(
|
|
663
|
+
done(
|
|
664
|
+
"\\PassOptionsToClass{compsoc}{IEEEtran}\n\\documentclass[conference]{IEEEtran}",
|
|
665
|
+
),
|
|
666
|
+
).toEqual(["cycle/port-done:done"]);
|
|
667
|
+
expect(
|
|
668
|
+
done(
|
|
669
|
+
"\\if\\v1 \\documentclass{article} \\fi\n\\if\\v2 \\documentclass[conference,compsoc]{IEEEtran} \\fi",
|
|
670
|
+
),
|
|
671
|
+
).toEqual(["cycle/port-done:done"]);
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
it("silent when the venue's template cannot be read", () => {
|
|
675
|
+
const own = `${PAPER}/own.jsonc`;
|
|
676
|
+
const extra = {
|
|
677
|
+
[own]: JSON.stringify({
|
|
678
|
+
type: "family",
|
|
679
|
+
template: "\\documentclass[a]{}",
|
|
680
|
+
tex: { packages: { x: ["x"] } },
|
|
681
|
+
}),
|
|
682
|
+
};
|
|
683
|
+
const cycles = [
|
|
684
|
+
{ ...PORTING, venue: { kind: "preset", extends: "./own.jsonc" } },
|
|
685
|
+
];
|
|
686
|
+
expect(
|
|
687
|
+
lint(OFFICIAL, { cycles }, { extra }).filter(
|
|
688
|
+
(f) => f.rule === "cycle/port-done",
|
|
689
|
+
),
|
|
690
|
+
).toEqual([]);
|
|
691
|
+
});
|
|
692
|
+
});
|
|
693
|
+
|
|
694
|
+
describe("cycle/port-done — the source code, and nothing to compare", () => {
|
|
402
695
|
it("judges the text when the source carries no `raw`", () => {
|
|
403
696
|
expect(
|
|
404
697
|
lint(OFFICIAL, { cycles: [PORTING] }, { raw: false }).map(
|
|
@@ -1208,6 +1501,8 @@ describe("otherVenues", () => {
|
|
|
1208
1501
|
if (!aidc.ok) return;
|
|
1209
1502
|
expect(otherVenues(aidc.value, deps).map((o) => [o.label, o.year])).toEqual(
|
|
1210
1503
|
[
|
|
1504
|
+
["AAAI", 2027],
|
|
1505
|
+
["aaai-press", null],
|
|
1211
1506
|
["acl-latex", null],
|
|
1212
1507
|
["acm-acmsmall", null],
|
|
1213
1508
|
["acm-sigconf", null],
|
|
@@ -1220,9 +1515,13 @@ describe("otherVenues", () => {
|
|
|
1220
1515
|
["ACM CCS", 2026],
|
|
1221
1516
|
["EMNLP", 2026],
|
|
1222
1517
|
["FSE", 2027],
|
|
1518
|
+
["ICML", 2027],
|
|
1519
|
+
["icml-style", null],
|
|
1223
1520
|
["ICSE", 2027],
|
|
1224
1521
|
["ICSE", 2028],
|
|
1225
1522
|
["MSR", 2027],
|
|
1523
|
+
["NeurIPS", 2026],
|
|
1524
|
+
["neurips-style", null],
|
|
1226
1525
|
["NLBSE", 2027],
|
|
1227
1526
|
["IEEE S&P", 2027],
|
|
1228
1527
|
],
|
|
@@ -1256,6 +1555,727 @@ describe("paperlint's own config", () => {
|
|
|
1256
1555
|
});
|
|
1257
1556
|
|
|
1258
1557
|
/** A conforming AIDC paper with `preamble` after its class line, and `body` before its statement. */
|
|
1558
|
+
const NEURIPS = { extends: "paperlint:neurips-2026", kind: "main" };
|
|
1559
|
+
const CHECKLIST =
|
|
1560
|
+
"\\section*{NeurIPS Paper Checklist}\n\\begin{enumerate}\\item x\\end{enumerate}\n";
|
|
1561
|
+
/** A paper in the kit's template: article, the style loaded after it. */
|
|
1562
|
+
const neuripsPaper = (body: string, preamble = "") =>
|
|
1563
|
+
paper(
|
|
1564
|
+
`\\documentclass{article}\n\\usepackage{neurips_2026}\n${preamble}`,
|
|
1565
|
+
body,
|
|
1566
|
+
);
|
|
1567
|
+
const NEURIPS_BIB =
|
|
1568
|
+
"\\begin{thebibliography}{1}\\bibitem{a} A. Author. Learning.\\end{thebibliography}\n";
|
|
1569
|
+
|
|
1570
|
+
describe("tex/required-section — NeurIPS's paper checklist", () => {
|
|
1571
|
+
it.each<[string, string]>([
|
|
1572
|
+
[
|
|
1573
|
+
"after the references and the appendix, as the kit puts it",
|
|
1574
|
+
BODY + NEURIPS_BIB + APPENDIX + CHECKLIST,
|
|
1575
|
+
],
|
|
1576
|
+
["straight after the references", BODY + NEURIPS_BIB + CHECKLIST],
|
|
1577
|
+
[
|
|
1578
|
+
"before the references: the order is only suggested",
|
|
1579
|
+
BODY + CHECKLIST + NEURIPS_BIB,
|
|
1580
|
+
],
|
|
1581
|
+
])("passes %s", (_, body) => {
|
|
1582
|
+
expect(lint(neuripsPaper(body), NEURIPS)).toEqual([]);
|
|
1583
|
+
});
|
|
1584
|
+
|
|
1585
|
+
it("passes from the kit's own \\input{checklist.tex}, as the build recorded it", () => {
|
|
1586
|
+
const tex = neuripsPaper(BODY + NEURIPS_BIB + "\\input{checklist.tex}\n");
|
|
1587
|
+
const extra = builtPaper(
|
|
1588
|
+
PAPER,
|
|
1589
|
+
{ "paper.tex": tex, "checklist.tex": CHECKLIST },
|
|
1590
|
+
[
|
|
1591
|
+
{ path: "paper.tex", role: "body" },
|
|
1592
|
+
{ path: "neurips_2026.sty", role: "preamble" },
|
|
1593
|
+
{ path: "checklist.tex", role: "body" },
|
|
1594
|
+
],
|
|
1595
|
+
);
|
|
1596
|
+
expect(lint(tex, NEURIPS, { extra })).toEqual([]);
|
|
1597
|
+
});
|
|
1598
|
+
|
|
1599
|
+
it.each<[string, string, number]>([
|
|
1600
|
+
["🔴 no checklist at all — a desk reject", BODY + NEURIPS_BIB, 12],
|
|
1601
|
+
[
|
|
1602
|
+
"🔴 a heading other than the kit's",
|
|
1603
|
+
BODY + NEURIPS_BIB + "\\section*{Paper Checklist}\nx\n",
|
|
1604
|
+
14,
|
|
1605
|
+
],
|
|
1606
|
+
])("%s", (_, body, line) => {
|
|
1607
|
+
expect(required(lint(neuripsPaper(body), NEURIPS))).toEqual([
|
|
1608
|
+
{
|
|
1609
|
+
rule: "tex/required-section",
|
|
1610
|
+
messageId: "missing",
|
|
1611
|
+
message:
|
|
1612
|
+
"NeurIPS requires a section titled «NeurIPS Paper Checklist» and there is none — add `\\section*{NeurIPS Paper Checklist}` (the title exactly; a bold paragraph does not count)",
|
|
1613
|
+
line,
|
|
1614
|
+
},
|
|
1615
|
+
]);
|
|
1616
|
+
});
|
|
1617
|
+
});
|
|
1618
|
+
|
|
1619
|
+
/** A paper whose preamble is `preamble`, under the NeurIPS family's class. */
|
|
1620
|
+
const articlePaper = (preamble: string, body = BODY + CHECKLIST) =>
|
|
1621
|
+
paper(`\\documentclass{article}\n${preamble}`, body);
|
|
1622
|
+
|
|
1623
|
+
describe("tex/template — a style file the template loads (`template_style`): what passes", () => {
|
|
1624
|
+
it.each<[string, string]>([
|
|
1625
|
+
["the kit's own line", "\\usepackage{neurips_2026}"],
|
|
1626
|
+
[
|
|
1627
|
+
"with options of the paper's own",
|
|
1628
|
+
"\\usepackage[preprint,nonatbib]{neurips_2026}",
|
|
1629
|
+
],
|
|
1630
|
+
["in a list with other packages", "\\usepackage{amsmath,neurips_2026}"],
|
|
1631
|
+
["as \\RequirePackage", "\\RequirePackage{neurips_2026}"],
|
|
1632
|
+
[
|
|
1633
|
+
"one of several lines behind a TeX switch",
|
|
1634
|
+
"\\if\\venue1 \\usepackage{iclr2027_conference} \\fi\n\\if\\venue2 \\usepackage{neurips_2026} \\fi",
|
|
1635
|
+
],
|
|
1636
|
+
])("%s", (_, preamble) => {
|
|
1637
|
+
expect(lint(articlePaper(preamble), NEURIPS)).toEqual([]);
|
|
1638
|
+
});
|
|
1639
|
+
|
|
1640
|
+
it("from a preamble the paper \\inputs, as the build recorded it", () => {
|
|
1641
|
+
const tex = articlePaper("\\input{preamble}");
|
|
1642
|
+
const extra = builtPaper(
|
|
1643
|
+
PAPER,
|
|
1644
|
+
{ "paper.tex": tex, "preamble.tex": "\\usepackage{neurips_2026}\n" },
|
|
1645
|
+
[
|
|
1646
|
+
{ path: "paper.tex", role: "body" },
|
|
1647
|
+
{ path: "preamble.tex", role: "preamble" },
|
|
1648
|
+
],
|
|
1649
|
+
);
|
|
1650
|
+
expect(lint(tex, NEURIPS, { extra })).toEqual([]);
|
|
1651
|
+
});
|
|
1652
|
+
|
|
1653
|
+
it("silent for a preset that names no style: REALM's article takes any package", () => {
|
|
1654
|
+
expect(
|
|
1655
|
+
lint(
|
|
1656
|
+
paper(
|
|
1657
|
+
"\\documentclass[11pt]{article}\n\\usepackage{neurips_2026}",
|
|
1658
|
+
"Text.",
|
|
1659
|
+
),
|
|
1660
|
+
{
|
|
1661
|
+
extends: "paperlint:realm",
|
|
1662
|
+
kind: "long",
|
|
1663
|
+
},
|
|
1664
|
+
),
|
|
1665
|
+
).toEqual([]);
|
|
1666
|
+
});
|
|
1667
|
+
});
|
|
1668
|
+
|
|
1669
|
+
describe("tex/template — a style file the template loads (`template_style`): what fails", () => {
|
|
1670
|
+
const template = (tex: string) =>
|
|
1671
|
+
lint(tex, NEURIPS).filter((f) => f.rule === "tex/template");
|
|
1672
|
+
|
|
1673
|
+
it("🔴 no style at all: the class alone does not pass", () => {
|
|
1674
|
+
expect(template(articlePaper("\\usepackage{amsmath}"))).toEqual([
|
|
1675
|
+
{
|
|
1676
|
+
rule: "tex/template",
|
|
1677
|
+
messageId: "missingStyle",
|
|
1678
|
+
message:
|
|
1679
|
+
"NeurIPS requires `\\usepackage{neurips_2026}`; paper.tex loads no such package — the page, the fonts and the margins the venue checks come from it",
|
|
1680
|
+
line: 1,
|
|
1681
|
+
},
|
|
1682
|
+
]);
|
|
1683
|
+
});
|
|
1684
|
+
|
|
1685
|
+
it("🔴 another year's NeurIPS style, at its line", () => {
|
|
1686
|
+
expect(template(articlePaper("\\usepackage{neurips_2025}"))).toEqual([
|
|
1687
|
+
{
|
|
1688
|
+
rule: "tex/template",
|
|
1689
|
+
messageId: "wrongStyle",
|
|
1690
|
+
message:
|
|
1691
|
+
"paper.tex loads `neurips_2025`, another venue's or another year's style; NeurIPS requires `\\usepackage{neurips_2026}`",
|
|
1692
|
+
line: 3,
|
|
1693
|
+
},
|
|
1694
|
+
]);
|
|
1695
|
+
});
|
|
1696
|
+
|
|
1697
|
+
it("🔴 a style commented out is not loaded", () => {
|
|
1698
|
+
expect(ids(template(articlePaper("% \\usepackage{neurips_2026}")))).toEqual(
|
|
1699
|
+
["tex/template:missingStyle"],
|
|
1700
|
+
);
|
|
1701
|
+
});
|
|
1702
|
+
|
|
1703
|
+
it("🔴 another class: the class finding alone (that class may load a style of its own)", () => {
|
|
1704
|
+
expect(
|
|
1705
|
+
ids(
|
|
1706
|
+
template(paper("\\documentclass[sigconf]{acmart}", BODY + CHECKLIST)),
|
|
1707
|
+
),
|
|
1708
|
+
).toEqual(["tex/template:wrongClass"]);
|
|
1709
|
+
});
|
|
1710
|
+
});
|
|
1711
|
+
|
|
1712
|
+
describe("otherStyles — the styles of the shipped venues off a paper's chain", () => {
|
|
1713
|
+
const files = memoryFiles(shipped);
|
|
1714
|
+
const deps = { files, ...READERS };
|
|
1715
|
+
const from = `${PAPER}/paperlint.json`;
|
|
1716
|
+
|
|
1717
|
+
it("names the other families' styles, not the paper's own; a style the reader cannot read is left out", () => {
|
|
1718
|
+
const neurips = resolvePreset("paperlint:neurips-2026", from, deps);
|
|
1719
|
+
expect(neurips.ok).toBe(true);
|
|
1720
|
+
if (!neurips.ok) return;
|
|
1721
|
+
const names = otherStyles(neurips.value, deps);
|
|
1722
|
+
expect(names).toEqual(expect.arrayContaining(["icml2027", "aaai2027"]));
|
|
1723
|
+
expect(names).not.toContain("neurips_2026");
|
|
1724
|
+
const unreadable = {
|
|
1725
|
+
...deps,
|
|
1726
|
+
latex: { ...latexReader, templateStyle: () => null },
|
|
1727
|
+
};
|
|
1728
|
+
expect(otherStyles(neurips.value, unreadable)).toEqual([]);
|
|
1729
|
+
});
|
|
1730
|
+
});
|
|
1731
|
+
|
|
1732
|
+
const AAAI_MAIN = { extends: "paperlint:aaai-2027", kind: "main" };
|
|
1733
|
+
/** tex/template on a paper under aaai-2027: its class line, then `preamble`. */
|
|
1734
|
+
const template = (
|
|
1735
|
+
preamble: string,
|
|
1736
|
+
cls = "\\documentclass[letterpaper]{article}",
|
|
1737
|
+
) =>
|
|
1738
|
+
lint(paper(`${cls}\n${preamble}`, "Text."), AAAI_MAIN).filter(
|
|
1739
|
+
(f) => f.rule === "tex/template",
|
|
1740
|
+
);
|
|
1741
|
+
|
|
1742
|
+
describe("tex/template under AAAI — a required style option passed with `\\PassOptionsToPackage`", () => {
|
|
1743
|
+
it("🔴 passed before the load, alone or in a list of packages: the option is in effect", () => {
|
|
1744
|
+
expect(
|
|
1745
|
+
template(
|
|
1746
|
+
"\\PassOptionsToPackage{submission}{aaai2027}\n\\usepackage{aaai2027}",
|
|
1747
|
+
),
|
|
1748
|
+
).toEqual([]);
|
|
1749
|
+
expect(
|
|
1750
|
+
template(
|
|
1751
|
+
"\\PassOptionsToPackage{submission}{times,aaai2027}\n\\usepackage{aaai2027}",
|
|
1752
|
+
),
|
|
1753
|
+
).toEqual([]);
|
|
1754
|
+
});
|
|
1755
|
+
});
|
|
1756
|
+
|
|
1757
|
+
describe("tex/template under AAAI — the options LaTeX hands the style: global ones, a macro's, not the class's alone", () => {
|
|
1758
|
+
it("🔴 a global option of the class line reaches the style: aaai2027.sty declares and processes it", () => {
|
|
1759
|
+
expect(
|
|
1760
|
+
template(
|
|
1761
|
+
"\\usepackage{aaai2027}",
|
|
1762
|
+
"\\documentclass[letterpaper,submission]{article}",
|
|
1763
|
+
),
|
|
1764
|
+
).toEqual([]);
|
|
1765
|
+
expect(
|
|
1766
|
+
template(
|
|
1767
|
+
"\\documentclass[letterpaper,submission]{article}\n\\RequirePackageWithOptions{aaai2027}",
|
|
1768
|
+
"",
|
|
1769
|
+
),
|
|
1770
|
+
).toEqual([]);
|
|
1771
|
+
});
|
|
1772
|
+
|
|
1773
|
+
it("🔴 an option built by a macro may carry it: silent, and the port is not called done", () => {
|
|
1774
|
+
expect(
|
|
1775
|
+
template(
|
|
1776
|
+
"\\usepackage{aaai2027}",
|
|
1777
|
+
"\\documentclass[letterpaper,\\opts]{article}",
|
|
1778
|
+
),
|
|
1779
|
+
).toEqual([]);
|
|
1780
|
+
const porting = {
|
|
1781
|
+
cycles: [
|
|
1782
|
+
{
|
|
1783
|
+
...PORTING,
|
|
1784
|
+
id: "aaai-2027",
|
|
1785
|
+
venue: { kind: "preset", extends: "paperlint:aaai-2027" },
|
|
1786
|
+
kind: "main",
|
|
1787
|
+
},
|
|
1788
|
+
],
|
|
1789
|
+
};
|
|
1790
|
+
const portDone = (cls: string) =>
|
|
1791
|
+
lint(paper(`${cls}\n\\usepackage{aaai2027}`, "Text."), porting).map(
|
|
1792
|
+
(f) => `${f.rule}:${f.messageId}`,
|
|
1793
|
+
);
|
|
1794
|
+
expect(portDone("\\documentclass[letterpaper,\\opts]{article}")).toEqual(
|
|
1795
|
+
[],
|
|
1796
|
+
);
|
|
1797
|
+
expect(
|
|
1798
|
+
portDone("\\documentclass[letterpaper,submission]{article}"),
|
|
1799
|
+
).toEqual(["cycle/port-done:done"]);
|
|
1800
|
+
});
|
|
1801
|
+
});
|
|
1802
|
+
|
|
1803
|
+
describe("tex/template under AAAI — a style loaded from a folder", () => {
|
|
1804
|
+
it("🔴 \\usepackage{sty/aaai2027} loads the package aaai2027: LaTeX names it by its file's base name", () => {
|
|
1805
|
+
expect(template("\\usepackage[submission]{sty/aaai2027}")).toEqual([]);
|
|
1806
|
+
expect(
|
|
1807
|
+
template("\\usepackage{sty/aaai2026}").map((f) => f.messageId),
|
|
1808
|
+
).toEqual(["wrongStyle"]);
|
|
1809
|
+
});
|
|
1810
|
+
});
|
|
1811
|
+
|
|
1812
|
+
describe("tex/template under AAAI — the options that do not reach the style", () => {
|
|
1813
|
+
it("🔴 passed to the class only: \\PassOptionsToClass does not make an option global", () => {
|
|
1814
|
+
expect(
|
|
1815
|
+
template(
|
|
1816
|
+
"\\usepackage{aaai2027}",
|
|
1817
|
+
"\\PassOptionsToClass{submission}{article}\n\\documentclass[letterpaper]{article}",
|
|
1818
|
+
).map((f) => f.messageId),
|
|
1819
|
+
).toEqual(["missingStyleOption"]);
|
|
1820
|
+
});
|
|
1821
|
+
|
|
1822
|
+
it("🔴 passed after the load, or to another package: the option is missing", () => {
|
|
1823
|
+
for (const preamble of [
|
|
1824
|
+
"\\usepackage{aaai2027}\n\\PassOptionsToPackage{submission}{aaai2027}",
|
|
1825
|
+
"\\PassOptionsToPackage{submission}{times}\n\\usepackage{aaai2027}",
|
|
1826
|
+
])
|
|
1827
|
+
expect(template(preamble).map((f) => f.messageId)).toEqual([
|
|
1828
|
+
"missingStyleOption",
|
|
1829
|
+
]);
|
|
1830
|
+
});
|
|
1831
|
+
});
|
|
1832
|
+
|
|
1833
|
+
const neurips = resolvePreset(
|
|
1834
|
+
"paperlint:neurips-2026",
|
|
1835
|
+
`${PAPER}/paperlint.json`,
|
|
1836
|
+
{ files: memoryFiles(shipped), venuesDir: VENUES },
|
|
1837
|
+
);
|
|
1838
|
+
const at = (start: number) => ({
|
|
1839
|
+
kind: "at" as const,
|
|
1840
|
+
span: { start, end: start + 1 },
|
|
1841
|
+
});
|
|
1842
|
+
|
|
1843
|
+
describe("judgeStyle — another shipped venue's style, and a required option", () => {
|
|
1844
|
+
it("🔴 a style another shipped venue names is reported by name; an unknown package is the paper's own", () => {
|
|
1845
|
+
expect(neurips.ok).toBe(true);
|
|
1846
|
+
if (!neurips.ok) return;
|
|
1847
|
+
const judge = (name: string) =>
|
|
1848
|
+
judgeStyle(
|
|
1849
|
+
{
|
|
1850
|
+
packages: [{ name, options: [], unread: [], place: at(5) }],
|
|
1851
|
+
others: ["icml2027", "aaai2027"],
|
|
1852
|
+
unseen: false,
|
|
1853
|
+
},
|
|
1854
|
+
neurips.value,
|
|
1855
|
+
latexReader,
|
|
1856
|
+
).map((f) => [f.messageId, f.data["got"] ?? ""]);
|
|
1857
|
+
expect(judge("icml2027")).toEqual([["wrongStyle", "icml2027"]]);
|
|
1858
|
+
expect(judge("aaai2027")).toEqual([["wrongStyle", "aaai2027"]]);
|
|
1859
|
+
expect(judge("iclr2027_conference")).toEqual([["missingStyle", ""]]);
|
|
1860
|
+
});
|
|
1861
|
+
|
|
1862
|
+
it("🔴 a required option missing is one finding per option, at the line; with it, silent", () => {
|
|
1863
|
+
expect(neurips.ok).toBe(true);
|
|
1864
|
+
if (!neurips.ok) return;
|
|
1865
|
+
const withOption = {
|
|
1866
|
+
...neurips.value,
|
|
1867
|
+
templateStyle: { text: "\\usepackage[main]{neurips_2026}", file: "x" },
|
|
1868
|
+
};
|
|
1869
|
+
const judge = (options: readonly string[]) =>
|
|
1870
|
+
judgeStyle(
|
|
1871
|
+
{
|
|
1872
|
+
packages: [
|
|
1873
|
+
{ name: "neurips_2026", options, unread: [], place: at(5) },
|
|
1874
|
+
],
|
|
1875
|
+
others: [],
|
|
1876
|
+
unseen: false,
|
|
1877
|
+
},
|
|
1878
|
+
withOption,
|
|
1879
|
+
latexReader,
|
|
1880
|
+
).map((f) => [f.messageId, f.data["option"] ?? ""]);
|
|
1881
|
+
expect(judge([])).toEqual([["missingStyleOption", "main"]]);
|
|
1882
|
+
expect(judge(["main", "final"])).toEqual([]);
|
|
1883
|
+
});
|
|
1884
|
+
});
|
|
1885
|
+
|
|
1886
|
+
/** tex/template and cycle/port-done findings on a NeurIPS paper. */
|
|
1887
|
+
const styleFindings = (tex: string, settings: object = NEURIPS) =>
|
|
1888
|
+
lint(tex, settings)
|
|
1889
|
+
.filter((f) => f.rule === "tex/template" || f.rule === "cycle/port-done")
|
|
1890
|
+
.map((f) => `${f.rule}:${f.messageId}`);
|
|
1891
|
+
const NEURIPS_PORT = {
|
|
1892
|
+
cycles: [
|
|
1893
|
+
{
|
|
1894
|
+
...PORTING,
|
|
1895
|
+
id: "neurips-2026",
|
|
1896
|
+
venue: { kind: "preset", extends: "paperlint:neurips-2026" },
|
|
1897
|
+
kind: "main",
|
|
1898
|
+
},
|
|
1899
|
+
],
|
|
1900
|
+
};
|
|
1901
|
+
|
|
1902
|
+
describe("the style check stays silent where the reader cannot see the style", () => {
|
|
1903
|
+
it.each<[string, string]>([
|
|
1904
|
+
["🔴 an \\input preamble with no build record yet", "\\input{preamble}"],
|
|
1905
|
+
["🔴 the style's name built by a macro", "\\usepackage{\\venuestyle}"],
|
|
1906
|
+
[
|
|
1907
|
+
"🔴 the name expanded from a macro",
|
|
1908
|
+
"\\expandafter\\usepackage\\expandafter{\\venuestyle}",
|
|
1909
|
+
],
|
|
1910
|
+
[
|
|
1911
|
+
"🔴 the load inside a macro the preamble calls",
|
|
1912
|
+
"\\newcommand{\\loadstyle}{\\usepackage{neurips_2026}}\n\\loadstyle",
|
|
1913
|
+
],
|
|
1914
|
+
[
|
|
1915
|
+
"🔴 the name in another case (a case-insensitive file system loads it)",
|
|
1916
|
+
"\\usepackage{NeurIPS_2026}",
|
|
1917
|
+
],
|
|
1918
|
+
[
|
|
1919
|
+
"🔴 another year's style beside an unread \\input that may load this one",
|
|
1920
|
+
"\\usepackage{neurips_2025}\n\\input{preamble}",
|
|
1921
|
+
],
|
|
1922
|
+
])(
|
|
1923
|
+
"%s: no tex/template finding, and the port is not called done",
|
|
1924
|
+
(_, preamble) => {
|
|
1925
|
+
const tex = paper(`\\documentclass{article}\n${preamble}`, "Text.");
|
|
1926
|
+
expect(styleFindings(tex)).toEqual([]);
|
|
1927
|
+
expect(styleFindings(tex, NEURIPS_PORT)).toEqual([]);
|
|
1928
|
+
},
|
|
1929
|
+
);
|
|
1930
|
+
});
|
|
1931
|
+
|
|
1932
|
+
describe("the style check over what the reader reads but TeX may not run", () => {
|
|
1933
|
+
it("🔴 the class line itself in an unread file: neither class nor style is judged", () => {
|
|
1934
|
+
expect(styleFindings(paper("\\input{header}", "Text."))).toEqual([]);
|
|
1935
|
+
});
|
|
1936
|
+
|
|
1937
|
+
it("a load behind a TeX switch counts as a load: which branch builds is not evaluated", () => {
|
|
1938
|
+
const tex = paper(
|
|
1939
|
+
"\\documentclass{article}\n\\ifdefined\\final\\usepackage[final]{neurips_2026}\\else\\usepackage{neurips_2026}\\fi",
|
|
1940
|
+
"Text.",
|
|
1941
|
+
);
|
|
1942
|
+
expect(styleFindings(tex)).toEqual([]);
|
|
1943
|
+
});
|
|
1944
|
+
});
|
|
1945
|
+
|
|
1946
|
+
describe("the style check reads what TeX reads: nothing after \\end{document}", () => {
|
|
1947
|
+
const parked = (preamble: string, after: string) =>
|
|
1948
|
+
`${paper(`\\documentclass{article}\n${preamble}`, "Text.")}${after}\n`;
|
|
1949
|
+
|
|
1950
|
+
it("🔴 a load parked after \\end{document} is no load: missingStyle, and the port is not done", () => {
|
|
1951
|
+
const tex = parked("", "\\usepackage{neurips_2026}");
|
|
1952
|
+
expect(styleFindings(tex)).toEqual(["tex/template:missingStyle"]);
|
|
1953
|
+
expect(styleFindings(tex, NEURIPS_PORT)).not.toContain(
|
|
1954
|
+
"cycle/port-done:done",
|
|
1955
|
+
);
|
|
1956
|
+
});
|
|
1957
|
+
|
|
1958
|
+
it("🔴 options passed and the style loaded again after \\end{document} do not count: missingStyleOption", () => {
|
|
1959
|
+
const tex = `${paper("\\documentclass[letterpaper]{article}\n\\usepackage{aaai2027}", "Text.")}\\PassOptionsToPackage{submission}{aaai2027}\n\\usepackage[submission]{aaai2027}\n`;
|
|
1960
|
+
expect(
|
|
1961
|
+
lint(tex, AAAI_MAIN)
|
|
1962
|
+
.filter((f) => f.rule === "tex/template")
|
|
1963
|
+
.map((f) => f.messageId),
|
|
1964
|
+
).toEqual(["missingStyleOption"]);
|
|
1965
|
+
});
|
|
1966
|
+
|
|
1967
|
+
it("🔴 a load inside a macro after \\end{document} hides nothing: missingStyle", () => {
|
|
1968
|
+
const tex = parked(
|
|
1969
|
+
"",
|
|
1970
|
+
"\\newcommand{\\loadstyle}{\\usepackage{neurips_2026}}",
|
|
1971
|
+
);
|
|
1972
|
+
expect(styleFindings(tex)).toEqual(["tex/template:missingStyle"]);
|
|
1973
|
+
});
|
|
1974
|
+
|
|
1975
|
+
it("a load before \\end{document} still counts, with text after it: no finding, and the port is done", () => {
|
|
1976
|
+
const tex = parked("\\usepackage{neurips_2026}", "% notes");
|
|
1977
|
+
expect(styleFindings(tex)).toEqual([]);
|
|
1978
|
+
expect(styleFindings(tex, NEURIPS_PORT)).toEqual(["cycle/port-done:done"]);
|
|
1979
|
+
});
|
|
1980
|
+
});
|
|
1981
|
+
|
|
1982
|
+
describe("the style check still speaks where the reader sees the whole preamble", () => {
|
|
1983
|
+
it.each<[string, string, string]>([
|
|
1984
|
+
[
|
|
1985
|
+
"🔴 a load behind \\iffalse is no load",
|
|
1986
|
+
"\\iffalse\n\\usepackage{neurips_2026}\n\\fi",
|
|
1987
|
+
"missingStyle",
|
|
1988
|
+
],
|
|
1989
|
+
["🔴 an \\input only in the body hides nothing", "", "missingStyle"],
|
|
1990
|
+
[
|
|
1991
|
+
"🔴 another year's style with no include",
|
|
1992
|
+
"\\usepackage{neurips_2025}",
|
|
1993
|
+
"wrongStyle",
|
|
1994
|
+
],
|
|
1995
|
+
])("%s", (_, preamble, messageId) => {
|
|
1996
|
+
const tex = paper(
|
|
1997
|
+
`\\documentclass{article}\n${preamble}`,
|
|
1998
|
+
"\\input{intro}\nText.",
|
|
1999
|
+
);
|
|
2000
|
+
expect(styleFindings(tex)).toEqual([`tex/template:${messageId}`]);
|
|
2001
|
+
});
|
|
2002
|
+
});
|
|
2003
|
+
|
|
2004
|
+
describe("judgeStyle — a template_style the reader cannot read", () => {
|
|
2005
|
+
it("a template_style that is not one \\usepackage line is said, naming the file", () => {
|
|
2006
|
+
expect(neurips.ok).toBe(true);
|
|
2007
|
+
if (!neurips.ok) return;
|
|
2008
|
+
const odd = {
|
|
2009
|
+
...neurips.value,
|
|
2010
|
+
templateStyle: { text: "\\usepackage{a,b}", file: "odd.jsonc" },
|
|
2011
|
+
};
|
|
2012
|
+
expect(
|
|
2013
|
+
judgeStyle(
|
|
2014
|
+
{ packages: [], others: [], unseen: false },
|
|
2015
|
+
odd,
|
|
2016
|
+
latexReader,
|
|
2017
|
+
).map((f) => f.messageId),
|
|
2018
|
+
).toEqual(["badStyle"]);
|
|
2019
|
+
});
|
|
2020
|
+
});
|
|
2021
|
+
|
|
2022
|
+
describe("format/layout-override and cycle/port-done under the NeurIPS style", () => {
|
|
2023
|
+
it("🔴 layout-override reports a \\newgeometry and a margin option; silent on the kit's preamble", () => {
|
|
2024
|
+
const overrides = (preamble: string, body = BODY + CHECKLIST) =>
|
|
2025
|
+
lint(articlePaper(preamble, body), NEURIPS)
|
|
2026
|
+
.filter((f) => f.rule === "format/layout-override")
|
|
2027
|
+
.map((f) => f.line);
|
|
2028
|
+
expect(
|
|
2029
|
+
overrides(
|
|
2030
|
+
"\\usepackage{neurips_2026}",
|
|
2031
|
+
"\\newgeometry{textwidth=6.5in}\n" + BODY + CHECKLIST,
|
|
2032
|
+
),
|
|
2033
|
+
).toEqual([5]);
|
|
2034
|
+
expect(
|
|
2035
|
+
overrides(
|
|
2036
|
+
"\\usepackage{neurips_2026}\n\\usepackage[margin=0.5in]{geometry}",
|
|
2037
|
+
),
|
|
2038
|
+
).toEqual([4]);
|
|
2039
|
+
expect(overrides("\\usepackage{neurips_2026}")).toEqual([]);
|
|
2040
|
+
});
|
|
2041
|
+
|
|
2042
|
+
const porting = {
|
|
2043
|
+
cycles: [
|
|
2044
|
+
{
|
|
2045
|
+
...PORTING,
|
|
2046
|
+
id: "neurips-2026",
|
|
2047
|
+
venue: { kind: "preset", extends: "paperlint:neurips-2026" },
|
|
2048
|
+
kind: "main",
|
|
2049
|
+
},
|
|
2050
|
+
],
|
|
2051
|
+
};
|
|
2052
|
+
|
|
2053
|
+
it("🔴 port-done: a port from another article-based style is not done while its style stays; done once the style is NeurIPS's", () => {
|
|
2054
|
+
const portDone = (preamble: string) =>
|
|
2055
|
+
lint(articlePaper(preamble, "Text."), porting).map(
|
|
2056
|
+
(f) => `${f.rule}:${f.messageId}`,
|
|
2057
|
+
);
|
|
2058
|
+
expect(portDone("\\usepackage{iclr2027_conference}")).toEqual([]);
|
|
2059
|
+
expect(portDone("\\usepackage{neurips_2026}")).toEqual([
|
|
2060
|
+
"cycle/port-done:done",
|
|
2061
|
+
]);
|
|
2062
|
+
});
|
|
2063
|
+
});
|
|
2064
|
+
|
|
2065
|
+
describe("tex/venue-leftover — NeurIPS counts only beside a recent year", () => {
|
|
2066
|
+
const under = (text: string) =>
|
|
2067
|
+
leftovers(lint(aidcPaper(`${text}\n${BODY}${STATEMENT}`), AIDC));
|
|
2068
|
+
|
|
2069
|
+
it.each([
|
|
2070
|
+
["the venue named alone", "Benchmarks popular at NeurIPS are larger."],
|
|
2071
|
+
[
|
|
2072
|
+
"related work: an edition older than the paper's own year minus one",
|
|
2073
|
+
"As shown at NeurIPS 2023, the bound is tight.",
|
|
2074
|
+
],
|
|
2075
|
+
])("silent: %s", (_, text) => {
|
|
2076
|
+
expect(under(text)).toEqual([]);
|
|
2077
|
+
});
|
|
2078
|
+
|
|
2079
|
+
it.each([
|
|
2080
|
+
["First written for NeurIPS 2026."],
|
|
2081
|
+
["A version appeared as NeurIPS'26 work."],
|
|
2082
|
+
["Submitted to NeurIPS~2026."],
|
|
2083
|
+
])("🔴 reported: «%s»", (text) => {
|
|
2084
|
+
expect(under(text).map((f) => f.message)).toEqual([
|
|
2085
|
+
expect.stringMatching(
|
|
2086
|
+
/^«NeurIPS» names NeurIPS 2026, and this paper extends AIDC 2026/,
|
|
2087
|
+
),
|
|
2088
|
+
]);
|
|
2089
|
+
});
|
|
2090
|
+
|
|
2091
|
+
it("under neurips itself, its own name with a year is never a leftover", () => {
|
|
2092
|
+
expect(
|
|
2093
|
+
leftovers(
|
|
2094
|
+
lint(neuripsPaper(`For NeurIPS 2026.\n${BODY}${CHECKLIST}`), NEURIPS),
|
|
2095
|
+
),
|
|
2096
|
+
).toEqual([]);
|
|
2097
|
+
});
|
|
2098
|
+
});
|
|
2099
|
+
|
|
2100
|
+
const AAAI = { extends: "paperlint:aaai-2027", kind: "main" };
|
|
2101
|
+
/** A paper in the AAAI-27 kit's template: its two lines, as the kit writes them. */
|
|
2102
|
+
const aaaiPaper = (
|
|
2103
|
+
body: string,
|
|
2104
|
+
style = "\\usepackage[submission]{aaai2027}",
|
|
2105
|
+
) => paper(`\\documentclass[letterpaper]{article}\n${style}`, body);
|
|
2106
|
+
|
|
2107
|
+
describe("tex/venue-leftover — AAAI counts only beside a recent year", () => {
|
|
2108
|
+
const under = (text: string) =>
|
|
2109
|
+
leftovers(lint(aidcPaper(`${text}\n${BODY}${STATEMENT}`), AIDC));
|
|
2110
|
+
|
|
2111
|
+
it.each([
|
|
2112
|
+
["the venue named alone", "Planners popular at AAAI are larger."],
|
|
2113
|
+
["its press", "The AAAI Press style sets two columns."],
|
|
2114
|
+
// 🔴 The call's own spelling is not reached: a hyphen is not a year beside the name (aaai-2027.md).
|
|
2115
|
+
["the call's spelling, with a hyphen", "First written for AAAI-27."],
|
|
2116
|
+
[
|
|
2117
|
+
"related work: an edition older than the paper's own year minus one",
|
|
2118
|
+
"As shown at AAAI 2024, the bound is tight.",
|
|
2119
|
+
],
|
|
2120
|
+
])("silent: %s", (_, text) => {
|
|
2121
|
+
expect(under(text)).toEqual([]);
|
|
2122
|
+
});
|
|
2123
|
+
|
|
2124
|
+
it.each([
|
|
2125
|
+
["First written for AAAI 2027."],
|
|
2126
|
+
["A version appeared as AAAI'27 work."],
|
|
2127
|
+
["Submitted to AAAI~2027."],
|
|
2128
|
+
])("🔴 reported: «%s»", (text) => {
|
|
2129
|
+
expect(under(text).map((f) => f.message)).toEqual([
|
|
2130
|
+
expect.stringMatching(
|
|
2131
|
+
/^«AAAI» names AAAI 2027, and this paper extends AIDC 2026/,
|
|
2132
|
+
),
|
|
2133
|
+
]);
|
|
2134
|
+
});
|
|
2135
|
+
|
|
2136
|
+
it("under aaai-2027 itself, its own name with a year is never a leftover", () => {
|
|
2137
|
+
expect(leftovers(lint(aaaiPaper(`For AAAI 2027.\n${BODY}`), AAAI))).toEqual(
|
|
2138
|
+
[],
|
|
2139
|
+
);
|
|
2140
|
+
});
|
|
2141
|
+
});
|
|
2142
|
+
|
|
2143
|
+
const ICML = { extends: "paperlint:icml-2027", kind: "main" };
|
|
2144
|
+
const IMPACT = "\\section*{Impact Statement}\nThis paper advances the field.\n";
|
|
2145
|
+
const ACK = "\\section*{Acknowledgements}\nThanks.\n";
|
|
2146
|
+
/** A paper in the kit's template: article, the style loaded after it. */
|
|
2147
|
+
const icmlPaper = (body: string, preamble = "") =>
|
|
2148
|
+
paper(`\\documentclass{article}\n\\usepackage{icml2027}\n${preamble}`, body);
|
|
2149
|
+
const ICML_BIB =
|
|
2150
|
+
"\\begin{thebibliography}{1}\\bibitem{a} A. Author. Learning.\\end{thebibliography}\n";
|
|
2151
|
+
|
|
2152
|
+
describe("tex/required-section — ICML's impact statement", () => {
|
|
2153
|
+
it.each<[string, string]>([
|
|
2154
|
+
[
|
|
2155
|
+
"before the acknowledgements and the references, as the kit puts it",
|
|
2156
|
+
BODY + IMPACT + ACK + ICML_BIB + APPENDIX,
|
|
2157
|
+
],
|
|
2158
|
+
[
|
|
2159
|
+
"after the acknowledgements: «the two may appear in either order»",
|
|
2160
|
+
BODY + ACK + IMPACT + ICML_BIB,
|
|
2161
|
+
],
|
|
2162
|
+
])("passes %s", (_, body) => {
|
|
2163
|
+
expect(lint(icmlPaper(body), ICML)).toEqual([]);
|
|
2164
|
+
});
|
|
2165
|
+
|
|
2166
|
+
it.each<[string, string, number]>([
|
|
2167
|
+
["🔴 no impact statement at all", BODY + ICML_BIB, 12],
|
|
2168
|
+
[
|
|
2169
|
+
"🔴 a heading other than the kit's",
|
|
2170
|
+
BODY + "\\section*{Broader Impact}\nx\n" + ICML_BIB,
|
|
2171
|
+
14,
|
|
2172
|
+
],
|
|
2173
|
+
])("%s", (_, body, line) => {
|
|
2174
|
+
expect(required(lint(icmlPaper(body), ICML))).toEqual([
|
|
2175
|
+
{
|
|
2176
|
+
rule: "tex/required-section",
|
|
2177
|
+
messageId: "missing",
|
|
2178
|
+
message:
|
|
2179
|
+
"ICML requires a section titled «Impact Statement» and there is none — add `\\section*{Impact Statement}` (the title exactly; a bold paragraph does not count)",
|
|
2180
|
+
line,
|
|
2181
|
+
},
|
|
2182
|
+
]);
|
|
2183
|
+
});
|
|
2184
|
+
|
|
2185
|
+
it("the AI Disclosure Statement, required by the call under no fixed title, is not checked", () => {
|
|
2186
|
+
expect(
|
|
2187
|
+
lint(icmlPaper(BODY + IMPACT + ICML_BIB), ICML).filter(
|
|
2188
|
+
(f) => f.rule === "tex/required-section",
|
|
2189
|
+
),
|
|
2190
|
+
).toEqual([]);
|
|
2191
|
+
});
|
|
2192
|
+
});
|
|
2193
|
+
|
|
2194
|
+
describe("the ICML style under tex/template, format/layout-override and cycle/port-done", () => {
|
|
2195
|
+
const found = (tex: string, settings: object = ICML) =>
|
|
2196
|
+
lint(tex, settings).map((f) => `${f.rule}:${f.messageId}`);
|
|
2197
|
+
|
|
2198
|
+
it("the kit's two lines pass; an option of the paper's own too", () => {
|
|
2199
|
+
expect(found(icmlPaper(BODY + IMPACT))).toEqual([]);
|
|
2200
|
+
expect(
|
|
2201
|
+
found(
|
|
2202
|
+
paper(
|
|
2203
|
+
"\\documentclass{article}\n\\usepackage[accepted]{icml2027}",
|
|
2204
|
+
BODY + IMPACT,
|
|
2205
|
+
),
|
|
2206
|
+
),
|
|
2207
|
+
).toEqual([]);
|
|
2208
|
+
});
|
|
2209
|
+
|
|
2210
|
+
it("🔴 another class, a margin, another venue's style, another ICML edition's: each reported", () => {
|
|
2211
|
+
expect(
|
|
2212
|
+
found(paper("\\documentclass[sigconf]{acmart}", BODY + IMPACT)),
|
|
2213
|
+
).toEqual(["tex/template:wrongClass"]);
|
|
2214
|
+
expect(
|
|
2215
|
+
found(icmlPaper(BODY + IMPACT, "\\usepackage[margin=0.6in]{geometry}")),
|
|
2216
|
+
).toEqual(["format/layout-override:override"]);
|
|
2217
|
+
expect(
|
|
2218
|
+
found(
|
|
2219
|
+
paper(
|
|
2220
|
+
"\\documentclass{article}\n\\usepackage{neurips_2025}",
|
|
2221
|
+
BODY + IMPACT,
|
|
2222
|
+
),
|
|
2223
|
+
),
|
|
2224
|
+
).toEqual(["tex/template:missingStyle"]);
|
|
2225
|
+
expect(
|
|
2226
|
+
found(
|
|
2227
|
+
paper(
|
|
2228
|
+
"\\documentclass{article}\n\\usepackage{neurips_2026}",
|
|
2229
|
+
BODY + IMPACT,
|
|
2230
|
+
),
|
|
2231
|
+
),
|
|
2232
|
+
).toEqual(["tex/template:wrongStyle"]);
|
|
2233
|
+
expect(
|
|
2234
|
+
found(
|
|
2235
|
+
paper(
|
|
2236
|
+
"\\documentclass{article}\n\\usepackage{icml2026}",
|
|
2237
|
+
BODY + IMPACT,
|
|
2238
|
+
),
|
|
2239
|
+
),
|
|
2240
|
+
).toEqual(["tex/template:wrongStyle"]);
|
|
2241
|
+
});
|
|
2242
|
+
});
|
|
2243
|
+
|
|
2244
|
+
describe("tex/venue-leftover — ICML counts only beside a recent year", () => {
|
|
2245
|
+
const under = (text: string) =>
|
|
2246
|
+
leftovers(lint(aidcPaper(`${text}\n${BODY}${STATEMENT}`), AIDC));
|
|
2247
|
+
|
|
2248
|
+
it.each([
|
|
2249
|
+
["the venue named alone", "Benchmarks popular at ICML are smaller."],
|
|
2250
|
+
// Measured in a NeurIPS 2025 paper's prose: a citation tag glued to its year is no whole word.
|
|
2251
|
+
["a tag glued to its year", "ELLM(ICML23) uses an LLM as a planner."],
|
|
2252
|
+
[
|
|
2253
|
+
"related work: an edition older than the paper's own year minus one",
|
|
2254
|
+
"As shown at ICML 2023, the bound is tight.",
|
|
2255
|
+
],
|
|
2256
|
+
])("silent: %s", (_, text) => {
|
|
2257
|
+
expect(under(text)).toEqual([]);
|
|
2258
|
+
});
|
|
2259
|
+
|
|
2260
|
+
it.each([
|
|
2261
|
+
["First written for ICML 2027."],
|
|
2262
|
+
["A version appeared as ICML'27 work."],
|
|
2263
|
+
["Submitted to ICML~2027."],
|
|
2264
|
+
])("🔴 reported: «%s»", (text) => {
|
|
2265
|
+
expect(under(text).map((f) => f.message)).toEqual([
|
|
2266
|
+
expect.stringMatching(
|
|
2267
|
+
/^«ICML» names ICML 2027, and this paper extends AIDC 2026/,
|
|
2268
|
+
),
|
|
2269
|
+
]);
|
|
2270
|
+
});
|
|
2271
|
+
|
|
2272
|
+
it("under icml-2027 itself, its own name with a year is never a leftover", () => {
|
|
2273
|
+
expect(
|
|
2274
|
+
leftovers(lint(icmlPaper(`For ICML 2027.\n${BODY}${IMPACT}`), ICML)),
|
|
2275
|
+
).toEqual([]);
|
|
2276
|
+
});
|
|
2277
|
+
});
|
|
2278
|
+
|
|
1259
2279
|
const withPreamble = (preamble: string, body = "Text.") =>
|
|
1260
2280
|
paper(
|
|
1261
2281
|
`\\documentclass[conference,compsoc]{IEEEtran}\n${preamble}`,
|