paperlint 17.1.0 → 17.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.md +2 -2
- package/README.md +24 -20
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +28 -29
- package/dist/cli.js.map +1 -1
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +6 -1
- package/dist/presets.js.map +1 -1
- package/dist/register-bands.d.ts +1 -7
- package/dist/register-bands.d.ts.map +1 -1
- package/dist/register-bands.js +12 -19
- package/dist/register-bands.js.map +1 -1
- package/dist/rule-sets.d.ts +43 -0
- package/dist/rule-sets.d.ts.map +1 -0
- package/dist/rule-sets.js +59 -0
- package/dist/rule-sets.js.map +1 -0
- package/dist/rules-config.d.ts +2 -1
- package/dist/rules-config.d.ts.map +1 -1
- package/dist/rules-config.js +17 -3
- package/dist/rules-config.js.map +1 -1
- package/docs/configuration.md +9 -2
- package/docs/optional-rules.md +48 -6
- package/docs/rules/tex/claim-emphasis.md +1 -1
- package/docs/rules/tex/claim-provenance.md +3 -3
- package/docs/rules/tex/contrast-frames.md +1 -1
- package/docs/rules/tex/max-caption-words.md +1 -1
- package/docs/rules/tex/max-paragraph-numbers.md +1 -1
- package/docs/rules/tex/max-paragraph-words.md +1 -1
- package/docs/rules/tex/max-sentence-words.md +1 -1
- package/docs/rules/tex/negated-sentences.md +1 -1
- package/docs/rules/tex/register.md +1 -1
- package/docs/rules/tex/relation-markers.md +1 -1
- package/docs/rules.md +20 -16
- package/fixtures/build-e2e/fse/PIPELINE-STATUS.md +3 -0
- package/fixtures/build-e2e/fse/expect.json +15 -0
- package/fixtures/build-e2e/fse/paper.tex +42 -0
- package/fixtures/build-e2e/fse/paperlint.json +1 -0
- package/fixtures/build-e2e/fse-over/PIPELINE-STATUS.md +3 -0
- package/fixtures/build-e2e/fse-over/expect.json +16 -0
- package/fixtures/build-e2e/fse-over/paper.tex +41 -0
- package/fixtures/build-e2e/fse-over/paperlint.json +1 -0
- package/fixtures/real-papers.test.ts +3 -0
- package/package.json +1 -1
- package/presets/acm-acmsmall.jsonc +115 -0
- package/presets/acm-acmsmall.md +62 -0
- package/presets/aidc.jsonc +2 -1
- package/presets/aidc.md +4 -3
- package/presets/fse.jsonc +93 -0
- package/presets/fse.md +143 -0
- package/src/cli.harness.mjs +25 -5
- package/src/cli.ts +43 -30
- package/src/folder-venue-rule.test.ts +11 -0
- package/src/lint-fix.test.ts +15 -2
- package/src/paper-includes.test.ts +62 -1
- package/src/paper-settings-commands.test.ts +1 -1
- package/src/preset-card-rule.test.ts +2 -0
- package/src/presets.test.ts +52 -1
- package/src/presets.ts +8 -1
- package/src/register-bands.ts +13 -23
- package/src/rule-cases.test.ts +155 -16
- package/src/rule-sets.test.ts +150 -0
- package/src/rule-sets.ts +63 -0
- package/src/rules-config.ts +31 -3
- package/src/tex-venue-rules.test.ts +53 -0
- package/src/venue-rules.test.ts +132 -2
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// FSE 2027 Research Papers (the ACM International Conference on the Foundations of Software
|
|
2
|
+
// Engineering, Shenzhen, 12-16 July 2027) — a VENUE preset over the ACM single-column family.
|
|
3
|
+
// Everything the acmart acmsmall template decides (page size, columns, fonts, font sizes, TeX
|
|
4
|
+
// packages) comes from acm-acmsmall.jsonc; this file adds what FSE's call for papers sets. Its card,
|
|
5
|
+
// in prose: `fse.md` beside this file.
|
|
6
|
+
//
|
|
7
|
+
// Verbatim from https://conf.researchr.org/track/fse-2027/fse-2027-papers (read 2026-11-19):
|
|
8
|
+
// «At the time of submission, each paper should have no more than 18 pages for all text and
|
|
9
|
+
// figures, plus 4 pages for references. Major revisions should have no more than 20 pages for
|
|
10
|
+
// all text and figures, plus 4 pages for references.»
|
|
11
|
+
// «Authors using LaTeX should use the sample-acmsmall-conf.tex file (found in the samples folder
|
|
12
|
+
// of the acmart package) with the acmsmall option. We also strongly encourage the use of the
|
|
13
|
+
// review, screen, and anonymous options as well. In summary, you want to use:
|
|
14
|
+
// \documentclass[acmsmall,screen,review,anonymous]{acmart}»
|
|
15
|
+
// «It is a single-column page layout. Submissions that do not comply with the above instructions
|
|
16
|
+
// will be desk rejected without review.»
|
|
17
|
+
// «the FSE 2027 Research Papers Track will employ a double-anonymous review process»
|
|
18
|
+
// «Papers that do not comply with the double-anonymous review process will be desk-rejected.»
|
|
19
|
+
// «Authors should provide a supporting statement on the availability of a replication package
|
|
20
|
+
// (or lack thereof) in their submitted papers in a section named Data Availability after the
|
|
21
|
+
// Conclusion section. This section will not be counted towards your page limit.»
|
|
22
|
+
// Its dates panel: «Fri 2 Oct 2026 Full paper submission», «Important Dates AoE (UTC-12h)»; and
|
|
23
|
+
// its banner: «Due to the system-wide HotCRP outage, we are extending the submission deadline by
|
|
24
|
+
// one day, to Oct. 3, AoE.»
|
|
25
|
+
{
|
|
26
|
+
"type": "venue",
|
|
27
|
+
// «FSE» alone is what papers write when they cite an FSE paper («ESEC/FSE», «FSE 2024»), so as a
|
|
28
|
+
// name it would flag every software-engineering paper that cites one (tex/venue-leftover), and
|
|
29
|
+
// `mentions: "with-year"` would still flag «FSE 2024». The edition is the name instead, the
|
|
30
|
+
// call's own spelling: «FSE 2027». A paper written for this edition and moved elsewhere carries
|
|
31
|
+
// that; one that cites last year's FSE does not. No alias: the call spells it no other way.
|
|
32
|
+
"name": "FSE 2027",
|
|
33
|
+
// The call quoted above.
|
|
34
|
+
"url": "https://conf.researchr.org/track/fse-2027/fse-2027-papers",
|
|
35
|
+
"extends": "paperlint:acm-acmsmall",
|
|
36
|
+
|
|
37
|
+
// No `template`, on purpose: the call requires `acmsmall` («with the acmsmall option», desk
|
|
38
|
+
// reject otherwise), which the family's `\documentclass[acmsmall]{acmart}` already requires, and
|
|
39
|
+
// only «strongly encourage[s]» review, screen and anonymous — so a paper without them is not
|
|
40
|
+
// refused by the call, and is not refused here.
|
|
41
|
+
|
|
42
|
+
// «double-anonymous review process» (the call above), and `"blind":true` in the portal's data
|
|
43
|
+
// (https://fse2027.hotcrp.com/deadlines, read 2026-11-19). anonymity/identity then requires the
|
|
44
|
+
// paper's `identity`.
|
|
45
|
+
"blind": true,
|
|
46
|
+
|
|
47
|
+
// «Submission link: https://fse2027.hotcrp.com/» (the call above).
|
|
48
|
+
"portal": { "kind": "hotcrp", "url": "https://fse2027.hotcrp.com" },
|
|
49
|
+
|
|
50
|
+
// 🔴 TWO READINGS OF ONE DEADLINE, KEPT BOTH. The portal, read 2026-11-19 on its public
|
|
51
|
+
// deadlines page: «Submission deadline: Saturday Oct 3, 2026, 11:59 PM AoE» (`"sub":1791115140`
|
|
52
|
+
// = 2026-10-04T11:59:00Z). The call's dates panel still says «Fri 2 Oct 2026», and its banner
|
|
53
|
+
// extends that «by one day, to Oct. 3, AoE»: the end of 3 Oct AoE, 2026-10-04T11:59:59Z. The two
|
|
54
|
+
// differ by 59 s; the portal's, the earlier, binds. The deadline has passed: it is kept as
|
|
55
|
+
// the record of the edition. The later dates (author response, notification, major revision)
|
|
56
|
+
// are in the card.
|
|
57
|
+
"deadlines": [
|
|
58
|
+
{
|
|
59
|
+
"what": "submission",
|
|
60
|
+
"at": "2026-10-04T11:59:00Z",
|
|
61
|
+
"source": "portal",
|
|
62
|
+
"url": "https://fse2027.hotcrp.com/deadlines",
|
|
63
|
+
"read": "2026-11-19",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"what": "submission",
|
|
67
|
+
"at": "2026-10-04T11:59:59Z",
|
|
68
|
+
"source": "call",
|
|
69
|
+
"url": "https://conf.researchr.org/track/fse-2027/fse-2027-papers",
|
|
70
|
+
"read": "2026-11-19",
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
|
|
74
|
+
// No `required_sections`, on purpose. The call asks for «a section named Data Availability after
|
|
75
|
+
// the Conclusion section», but only that authors «should» provide it, and no desk reject is
|
|
76
|
+
// named for its absence; a check ships on by default only when the venue's text requires it. The
|
|
77
|
+
// card says so.
|
|
78
|
+
|
|
79
|
+
"format": {
|
|
80
|
+
// «no more than 18 pages for all text and figures, plus 4 pages for references» — a body limit
|
|
81
|
+
// with its references, counted by banal (body and reference pages). 🔴 What the count cannot
|
|
82
|
+
// say, in the card: the Data Availability section «will not be counted towards your page
|
|
83
|
+
// limit», and no field excludes one section from the body count, so a Data Availability that
|
|
84
|
+
// fills a page of its own before the references counts as body here.
|
|
85
|
+
"kinds": {
|
|
86
|
+
"research": { "body_pages_max": 18, "ref_pages_max": 4 },
|
|
87
|
+
// «Major revisions should have no more than 20 pages for all text and figures, plus 4 pages
|
|
88
|
+
// for references.» The same paper after a major-revision decision: its paperlint.json
|
|
89
|
+
// switches `kind`.
|
|
90
|
+
"major-revision": { "body_pages_max": 20, "ref_pages_max": 4 },
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
}
|
package/presets/fse.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "FSE 2027 — venue card"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# FSE 2027 (Research Papers)
|
|
6
|
+
|
|
7
|
+
The card of the venue preset `paperlint:fse` ([`fse.jsonc`](fse.jsonc)): what the venue asks for, in
|
|
8
|
+
prose. The numbers a machine checks live in the preset; the section at the end is generated from
|
|
9
|
+
it. The `submit-paper` skill reads this card for the venue's specifics.
|
|
10
|
+
|
|
11
|
+
**Re-verify the call for papers every year**
|
|
12
|
+
([conf.researchr.org/track/fse-2027/fse-2027-papers](https://conf.researchr.org/track/fse-2027/fse-2027-papers)):
|
|
13
|
+
limits, dates and the venue's name in the preset (`FSE 2027`) change between editions.
|
|
14
|
+
|
|
15
|
+
## Sources
|
|
16
|
+
|
|
17
|
+
Each read on 2026-11-19:
|
|
18
|
+
|
|
19
|
+
- the call: <https://conf.researchr.org/track/fse-2027/fse-2027-papers>;
|
|
20
|
+
- the dates page: <https://conf.researchr.org/dates/fse-2027>;
|
|
21
|
+
- the portal's public deadlines page: <https://fse2027.hotcrp.com/deadlines>.
|
|
22
|
+
|
|
23
|
+
## The venue (2027 edition)
|
|
24
|
+
|
|
25
|
+
- **Venue**: the Research Papers track of **FSE 2027**, the ACM International Conference on the
|
|
26
|
+
Foundations of Software Engineering, Shenzhen, China, 12–16 July 2027.
|
|
27
|
+
- **Portal**: HotCRP, `https://fse2027.hotcrp.com/` («Submission link: https://fse2027.hotcrp.com/»).
|
|
28
|
+
- **Format**, verbatim from the call: «Authors using LaTeX should use the sample-acmsmall-conf.tex
|
|
29
|
+
file (found in the samples folder of the acmart package) with the acmsmall option. We also
|
|
30
|
+
strongly encourage the use of the review, screen, and anonymous options as well. In summary, you
|
|
31
|
+
want to use: `\documentclass[acmsmall,screen,review,anonymous]{acmart}`», «It is a single-column
|
|
32
|
+
page layout. Submissions that do not comply with the above instructions will be desk rejected
|
|
33
|
+
without review.» In acmart v2.21 (TeX Live 2026) the sample is `samples/acmsmall-conf.tex`; no
|
|
34
|
+
file of the call's name is in the package.
|
|
35
|
+
- **Double-anonymous**, and «heavy»: «The double-anonymous process used is "heavy", i.e., the paper
|
|
36
|
+
anonymity will be maintained during all reviewing and discussion periods. In case of major
|
|
37
|
+
revision, authors must therefore maintain anonymity in their response letter», and «Papers that
|
|
38
|
+
do not comply with the double-anonymous review process will be desk-rejected.» The call asks for
|
|
39
|
+
names and affiliations left out, one's own work cited in the third person, no author-revealing
|
|
40
|
+
URLs, organization names anonymized, no acknowledgements at submission, and no preprint saying
|
|
41
|
+
it was submitted to FSE 2027. The portal's data says `"blind":true`.
|
|
42
|
+
- **Data Availability**: «Authors should provide a supporting statement on the availability of a
|
|
43
|
+
replication package (or lack thereof) in their submitted papers in a section named Data
|
|
44
|
+
Availability after the Conclusion section. This section will not be counted towards your page
|
|
45
|
+
limit.» The same call, in its open-science policy: «This statement will not count towards the page
|
|
46
|
+
limit for the submission. Be careful that such statements continue to maintain author anonymity.»
|
|
47
|
+
- **References**: «Submissions will be checked for fabricated, hallucinated, or unverifiable
|
|
48
|
+
references. Papers containing confirmed fabricated or hallucinated citations will be
|
|
49
|
+
desk-rejected without review.» Hidden prompts aimed at reviewers or AI systems may also lead to
|
|
50
|
+
desk rejection. Generative AI: «FSE 2027 follows the ACM Policy on Authorship and the Use of
|
|
51
|
+
Generative AI Tools and Technologies.»
|
|
52
|
+
- **Open access**: accepted papers are published open access; without ACM Open at an author's
|
|
53
|
+
institution, the 2027 article processing charge is «USD500 APC for ACM/SIG members and USD750 for
|
|
54
|
+
non-members».
|
|
55
|
+
- **Attendance**: «Attendance at the event is not mandatory for publication. Authors also have the
|
|
56
|
+
option of not presenting their work at the conference, in which case they do not need to
|
|
57
|
+
register.»
|
|
58
|
+
|
|
59
|
+
## Dates
|
|
60
|
+
|
|
61
|
+
The call's panel, «Important Dates AoE (UTC-12h)», and the dates page agree:
|
|
62
|
+
|
|
63
|
+
| date | what |
|
|
64
|
+
| -------------------------- | ------------------------------------------------------- |
|
|
65
|
+
| Fri 2 Oct 2026 → **3 Oct** | full paper submission (extended by one day, see below) |
|
|
66
|
+
| Mon 14 – Fri 18 Dec 2026 | author response period |
|
|
67
|
+
| Fri 22 Jan 2027 | initial notification (accept, reject or major revision) |
|
|
68
|
+
| Fri 5 Mar 2027 | major revision submission |
|
|
69
|
+
| Wed 31 Mar 2027 | final notification |
|
|
70
|
+
|
|
71
|
+
**The submission deadline, two readings, both in the preset** (`deadlines`):
|
|
72
|
+
|
|
73
|
+
- the call: its panel says «Fri 2 Oct 2026», and a banner above the call says «Due to the
|
|
74
|
+
system-wide HotCRP outage, we are extending the submission deadline by one day, to Oct. 3, AoE.»
|
|
75
|
+
The end of 3 Oct AoE is 2026-10-04 11:59:59 UTC;
|
|
76
|
+
- the portal: «Submission deadline: Saturday Oct 3, 2026, 11:59 PM AoE» (`"sub":1791115140`,
|
|
77
|
+
2026-10-04 11:59:00 UTC).
|
|
78
|
+
|
|
79
|
+
The portal is what refuses an upload, and its reading is 59 s the earlier, so it binds. The deadline
|
|
80
|
+
has passed; the preset keeps it as the record of the edition.
|
|
81
|
+
|
|
82
|
+
## Paper kinds and limits
|
|
83
|
+
|
|
84
|
+
| kind | body pages | pages of references | what the call says |
|
|
85
|
+
| ---------------- | ---------: | ------------------: | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
86
|
+
| `research` | 18 | 4 | «At the time of submission, each paper should have no more than 18 pages for all text and figures, plus 4 pages for references.» |
|
|
87
|
+
| `major-revision` | 20 | 4 | «Major revisions should have no more than 20 pages for all text and figures, plus 4 pages for references.» |
|
|
88
|
+
|
|
89
|
+
A paper names its kind in its `paperlint.json`; after a major-revision decision, the same paper
|
|
90
|
+
switches from `research` to `major-revision`.
|
|
91
|
+
|
|
92
|
+
🔴 **What the page count cannot express.** The Data Availability section does not count toward the
|
|
93
|
+
limit, and no preset field takes one section out of the body count. The count is banal's
|
|
94
|
+
([`acm-acmsmall.md`](acm-acmsmall.md) says how banal reads this format), and a Data Availability
|
|
95
|
+
section is body text to it: one that pushes the body onto a 19th page is reported over the limit
|
|
96
|
+
although FSE allows it. A `% eslint-disable` comment in `paper.tex` does not silence
|
|
97
|
+
`format/page-limit` (tried 2026-11-19); such a paper turns the rule off in its own `paperlint.json`
|
|
98
|
+
(`"rules": { "format/page-limit": "off" }`) and checks its 18 pages by eye.
|
|
99
|
+
|
|
100
|
+
## What else the preset encodes
|
|
101
|
+
|
|
102
|
+
- **The ACM single-column template**, through `extends: paperlint:acm-acmsmall` — 6.75 × 10 in, one
|
|
103
|
+
column, Libertine at 10 pt, acmart's TeX packages ([`acm-acmsmall.md`](acm-acmsmall.md)) — with
|
|
104
|
+
`acmsmall` required in the class line (`tex/template`). `review`, `screen` and `anonymous` are
|
|
105
|
+
not required: the call only «strongly encourage[s]» them.
|
|
106
|
+
- **Double-blind review** (`blind`), so `anonymity/identity` checks the PDF against the paper's
|
|
107
|
+
declared `identity`.
|
|
108
|
+
- **Not the Data Availability section.** The call asks for a section named «Data Availability»
|
|
109
|
+
after the Conclusion, but says authors «should» provide it and names no desk reject for its
|
|
110
|
+
absence, so paperlint does not check it (no `required_sections`): add it yourself.
|
|
111
|
+
- **Where submissions go** (`portal`): `paperlint submission` reads and updates a paper's
|
|
112
|
+
submission through HotCRP's API on that site.
|
|
113
|
+
- **Names**: `FSE 2027`, what `tex/venue-leftover` and `paper/folder-venue-leftover` look for in
|
|
114
|
+
another venue's paper. Not the bare «FSE»: papers write it whenever they cite an FSE paper
|
|
115
|
+
(«ESEC/FSE», «FSE 2024»), and `mentions: "with-year"` would still flag «FSE 2024». The year is
|
|
116
|
+
the edition this preset describes; the call spells the venue no other way («FSE'27» does not
|
|
117
|
+
occur), so there is no alias.
|
|
118
|
+
|
|
119
|
+
## Not verified
|
|
120
|
+
|
|
121
|
+
- **Appendices.** The call says «18 pages for all text and figures» and does not mention
|
|
122
|
+
appendices. banal counts an appendix after the references as appendix, not body, so an appendix
|
|
123
|
+
there is not counted toward the 18 pages; whether FSE counts it is not stated.
|
|
124
|
+
- **What a reference page may hold**: «plus 4 pages for references» does not say whether those
|
|
125
|
+
pages hold only references.
|
|
126
|
+
- **The camera-ready**: its date and its page limit are not in the call.
|
|
127
|
+
- **The portal's form fields** (`submission_fields`): not recorded; that needs a logged-in read of
|
|
128
|
+
the form.
|
|
129
|
+
- **Remote presentation**: the call makes attendance optional for publication, and says nothing of
|
|
130
|
+
a remote talk.
|
|
131
|
+
|
|
132
|
+
## What the preset resolves to
|
|
133
|
+
|
|
134
|
+
<!-- paperlint:preset-rules -->
|
|
135
|
+
<!-- prettier-ignore-start -->
|
|
136
|
+
<!-- Generated from fse.jsonc by `npx eslint --fix` (rule preset/card-rules). Edit the preset, not this section. -->
|
|
137
|
+
|
|
138
|
+
**`paperlint:fse`** — venue preset for FSE 2027 · call for papers: <https://conf.researchr.org/track/fse-2027/fse-2027-papers> · extends `paperlint:acm-acmsmall`
|
|
139
|
+
|
|
140
|
+
No preset of this chain sets a rule: under it, every rule keeps paperlint's default.
|
|
141
|
+
|
|
142
|
+
<!-- prettier-ignore-end -->
|
|
143
|
+
<!-- /paperlint:preset-rules -->
|
package/src/cli.harness.mjs
CHANGED
|
@@ -917,9 +917,13 @@ check(
|
|
|
917
917
|
join(paper, "PIPELINE-STATUS.md"),
|
|
918
918
|
`---\nstages:\n - stage: submitted\n date: 2026-07-22\n pdf: versions/2026-07-22-submitted.pdf\n bytes: 100\n source: versions/s.tex\n sourceBytes: 4\n---\n# S\n\n| id | note |\n|---|---|\n| cites | bib-authors run |\n`,
|
|
919
919
|
);
|
|
920
|
+
// `paper/section-word` is in the opt-in writing set: on for every paper here.
|
|
920
921
|
writeFileSync(
|
|
921
922
|
join(root, "paperlint.json"),
|
|
922
|
-
JSON.stringify({
|
|
923
|
+
JSON.stringify({
|
|
924
|
+
[PAPERS_DIR_FIELD]: "papers",
|
|
925
|
+
rules: { "paperlint:writing": "warn" },
|
|
926
|
+
}),
|
|
923
927
|
);
|
|
924
928
|
|
|
925
929
|
const lax = await cli(["lint"], root);
|
|
@@ -1036,10 +1040,17 @@ check(
|
|
|
1036
1040
|
// (`"papers/p"`). Keys are computed against ESLint's `cwd`, so a run started from a
|
|
1037
1041
|
// subdirectory, or with `--config` from elsewhere, silently stopped honouring the debt.
|
|
1038
1042
|
{
|
|
1043
|
+
// A message that names the paper's own `paperlint.json` names it as the reader typed it, so
|
|
1044
|
+
// relative to where the run started: that path is the run's, like the file paths, and is masked.
|
|
1039
1045
|
const findings = (r) => {
|
|
1040
1046
|
try {
|
|
1041
1047
|
return JSON.parse(r.stdout)
|
|
1042
|
-
.flatMap((x) =>
|
|
1048
|
+
.flatMap((x) =>
|
|
1049
|
+
x.messages.map(
|
|
1050
|
+
(m) =>
|
|
1051
|
+
`${m.ruleId}: ${m.message.replace(/\S*papers\/p\/paperlint\.json/g, "<paper>/paperlint.json")}`,
|
|
1052
|
+
),
|
|
1053
|
+
)
|
|
1043
1054
|
.sort();
|
|
1044
1055
|
} catch {
|
|
1045
1056
|
return [`UNPARSABLE: ${r.out}`];
|
|
@@ -1052,8 +1063,14 @@ check(
|
|
|
1052
1063
|
try {
|
|
1053
1064
|
const paper = join(tree, "papers", "p");
|
|
1054
1065
|
mkdirSync(paper, { recursive: true });
|
|
1055
|
-
// Two findings of different kinds: a structural one (no scorecard) and a rule one (`§`).
|
|
1066
|
+
// Two findings of different kinds: a structural one (no scorecard) and a rule one (`§`). The
|
|
1067
|
+
// `§` rule is in the opt-in writing set, turned on in the paper's own file, which is read
|
|
1068
|
+
// wherever the command runs.
|
|
1056
1069
|
writeFileSync(join(paper, "paper.tex"), tex("See § 3 and §4."));
|
|
1070
|
+
writeFileSync(
|
|
1071
|
+
join(paper, "paperlint.json"),
|
|
1072
|
+
JSON.stringify({ rules: { "paperlint:writing": "warn" } }),
|
|
1073
|
+
);
|
|
1057
1074
|
|
|
1058
1075
|
const inside = await cli(["lint", "--json", "papers"], tree);
|
|
1059
1076
|
const outside = await cli(
|
|
@@ -1077,12 +1094,15 @@ check(
|
|
|
1077
1094
|
);
|
|
1078
1095
|
|
|
1079
1096
|
// A `rules` block, its `files` relative to the config's directory, turns the `§` rule off
|
|
1080
|
-
// for this paper — and it must reach the paper from wherever the command runs.
|
|
1097
|
+
// for this paper — and it must reach the paper from wherever the command runs. The set moves
|
|
1098
|
+
// to the root file, before the block: a paper's own file would win over the root's.
|
|
1099
|
+
rmSync(join(paper, "paperlint.json"));
|
|
1081
1100
|
writeFileSync(
|
|
1082
1101
|
join(tree, "paperlint.json"),
|
|
1083
1102
|
JSON.stringify({
|
|
1084
1103
|
[PAPERS_DIR_FIELD]: "papers",
|
|
1085
1104
|
rules: [
|
|
1105
|
+
{ rules: { "paperlint:writing": "warn" } },
|
|
1086
1106
|
{ files: ["papers/p/**"], rules: { "paper/section-word": "off" } },
|
|
1087
1107
|
],
|
|
1088
1108
|
}),
|
|
@@ -1859,7 +1879,7 @@ console.log(
|
|
|
1859
1879
|
),
|
|
1860
1880
|
);
|
|
1861
1881
|
settings({
|
|
1862
|
-
rules: [{ files: ["papers/**"], rules: { "
|
|
1882
|
+
rules: [{ files: ["papers/**"], rules: { "tex/future-promise": "off" } }],
|
|
1863
1883
|
});
|
|
1864
1884
|
check(
|
|
1865
1885
|
"a built-in rule's severity can be changed the same way",
|
package/src/cli.ts
CHANGED
|
@@ -47,6 +47,7 @@ import {
|
|
|
47
47
|
FRAGMENT_FILES,
|
|
48
48
|
includeBlocks,
|
|
49
49
|
paperBodies,
|
|
50
|
+
type PaperBody,
|
|
50
51
|
} from "./paper-includes.ts";
|
|
51
52
|
import { omit } from "remeda";
|
|
52
53
|
import { refusalOf } from "./unowned-file.ts";
|
|
@@ -89,10 +90,7 @@ import {
|
|
|
89
90
|
import { claimProvenanceRule } from "./claim-provenance.ts";
|
|
90
91
|
import { termDefinitionRules } from "./term-definition-rules.ts";
|
|
91
92
|
import { registerRule } from "./register.ts";
|
|
92
|
-
import {
|
|
93
|
-
REGISTER_BAND_RULE_LEVELS,
|
|
94
|
-
registerBandRules,
|
|
95
|
-
} from "./register-bands.ts";
|
|
93
|
+
import { registerBandRules } from "./register-bands.ts";
|
|
96
94
|
import { headingCaseRule } from "./heading-case.ts";
|
|
97
95
|
import {
|
|
98
96
|
maxParagraphNumbersRule,
|
|
@@ -577,11 +575,10 @@ export function buildConfig(
|
|
|
577
575
|
...referenceRules(RECORDED_DEPS),
|
|
578
576
|
...sourcesRules(RECORD_DEPS),
|
|
579
577
|
};
|
|
580
|
-
//
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
};
|
|
578
|
+
// The typography rules (each fixes what it reports, `--fix`), `tex/claim-provenance`,
|
|
579
|
+
// `tex/register` and the register bands are registered here and on for no file: they flag the
|
|
580
|
+
// writing, not what the venue decides, so they are in the opt-in set `paperlint:writing`
|
|
581
|
+
// (src/rule-sets.ts).
|
|
585
582
|
const md = MARKDOWN_WITH_FRONTMATTER;
|
|
586
583
|
|
|
587
584
|
const cfg: ConfigBlock[] = [
|
|
@@ -687,19 +684,10 @@ export function buildConfig(
|
|
|
687
684
|
},
|
|
688
685
|
language: "tex/latex",
|
|
689
686
|
rules: {
|
|
690
|
-
...prose,
|
|
691
687
|
...REFERENCE_RULE_LEVELS,
|
|
692
688
|
...SOURCES_RULE_LEVELS,
|
|
693
|
-
"paper/figure-ref-style": "warn",
|
|
694
689
|
...BIB_RULE_LEVELS,
|
|
695
690
|
"tex/future-promise": "warn",
|
|
696
|
-
// A number with no owner: a prose rule, on beside the others above.
|
|
697
|
-
"tex/claim-provenance": "warn",
|
|
698
|
-
// Sentence-initial conjunctions over the whole body: register, not vocabulary.
|
|
699
|
-
"tex/register": "warn",
|
|
700
|
-
// Contrast frames, claims in bold, relation markers: each against the band the venue
|
|
701
|
-
// preset's anchors set, silent for a preset without anchors (src/register-bands.ts).
|
|
702
|
-
...REGISTER_BAND_RULE_LEVELS,
|
|
703
691
|
"tex/acm-frontmatter-override": "error",
|
|
704
692
|
// Silent for a paper whose paperlint.json names no venue (src/venue-rules.ts).
|
|
705
693
|
...VENUE_RULE_LEVELS,
|
|
@@ -737,12 +725,9 @@ export function buildConfig(
|
|
|
737
725
|
},
|
|
738
726
|
},
|
|
739
727
|
language: "tex/latex",
|
|
740
|
-
rules
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
"paper/figure-ref-style": "warn",
|
|
744
|
-
"tex/future-promise": "warn",
|
|
745
|
-
},
|
|
728
|
+
// The typography rules are registered here so the writing set reaches a body file too;
|
|
729
|
+
// like on `paper.tex`, they are on only where a `rules` setting turns them on.
|
|
730
|
+
rules: { "tex/future-promise": "warn" },
|
|
746
731
|
},
|
|
747
732
|
]
|
|
748
733
|
: [];
|
|
@@ -872,7 +857,22 @@ export const OPTIONAL_RULES: ReadonlySet<string> = new Set(
|
|
|
872
857
|
* project. Judged against the run alone, `paperlint lint papers/c` failed on a block written for
|
|
873
858
|
* papers a and b (#103) — a block that reaches a paper outside this run is not dead. A glob that
|
|
874
859
|
* reaches no paper of the project at all still fails, from a subset as from the whole.
|
|
860
|
+
*
|
|
861
|
+
* A paper's rules reach it through its `PIPELINE-STATUS.md` too, and the typography rules through
|
|
862
|
+
* every body file handed to ESLint (`bodyFiles`): a block whose `files` name only `sections/*.tex`
|
|
863
|
+
* runs there, and was refused as reaching nothing until those files were probed as well. They are
|
|
864
|
+
* the files read from each paper's record BEFORE the run (`bodyFilesOf`), never read again after
|
|
865
|
+
* it: `--fix` rewrites a body file, the record no longer matches it, and a second read found no
|
|
866
|
+
* body files and refused a run whose rule had just fixed one.
|
|
875
867
|
*/
|
|
868
|
+
/** The body files `bodies` handed to ESLint, for the paper whose `paper.tex` is `main`. */
|
|
869
|
+
const bodyFilesOf =
|
|
870
|
+
(bodies: readonly PaperBody[]) =>
|
|
871
|
+
(main: string): readonly string[] =>
|
|
872
|
+
bodies
|
|
873
|
+
.filter((b) => resolve(b.main) === resolve(main))
|
|
874
|
+
.flatMap((b) => b.files);
|
|
875
|
+
|
|
876
876
|
/** What `calculateConfigForFile` answers, read for its rules: undefined for a file outside ESLint's cwd or scope. */
|
|
877
877
|
const ComputedConfig = z
|
|
878
878
|
.object({ rules: z.record(z.string(), z.unknown()).optional() })
|
|
@@ -882,6 +882,7 @@ export async function silentOptionalRules(
|
|
|
882
882
|
eslint: Pick<ESLint, "calculateConfigForFile">,
|
|
883
883
|
files: readonly string[],
|
|
884
884
|
opts: PaperlintConfig,
|
|
885
|
+
bodyFiles: (main: string) => readonly string[] = () => [],
|
|
885
886
|
): Promise<string[]> {
|
|
886
887
|
const turnedOn = new Set(
|
|
887
888
|
(opts.rules ?? []).flatMap((b) =>
|
|
@@ -891,11 +892,11 @@ export async function silentOptionalRules(
|
|
|
891
892
|
),
|
|
892
893
|
);
|
|
893
894
|
const reached = new Set<string>();
|
|
894
|
-
// A paper's rules reach it through
|
|
895
|
-
//
|
|
895
|
+
// A paper's rules reach it through `paper.tex`, the `PIPELINE-STATUS.md` beside it, where the
|
|
896
|
+
// rules about the paper folder itself run, and the body files its last build recorded.
|
|
896
897
|
const probes = [
|
|
897
898
|
...new Set(files.filter((p) => basename(p) === MAIN)),
|
|
898
|
-
].flatMap((f) => [f, join(dirname(f), STATUS_FILE)]);
|
|
899
|
+
].flatMap((f) => [f, join(dirname(f), STATUS_FILE), ...bodyFiles(f)]);
|
|
899
900
|
for (const probe of probes) {
|
|
900
901
|
// Undefined for a file outside ESLint's cwd or scope: it reaches nothing.
|
|
901
902
|
const cfg = ComputedConfig.parse(
|
|
@@ -2367,7 +2368,7 @@ export async function run(
|
|
|
2367
2368
|
stats: true,
|
|
2368
2369
|
});
|
|
2369
2370
|
if (!engine.ok) return (err(engine.error), 2);
|
|
2370
|
-
const { eslint, opts: withPapers } = engine.value;
|
|
2371
|
+
const { eslint, opts: withPapers, bodies } = engine.value;
|
|
2371
2372
|
|
|
2372
2373
|
const unowned = await firstUnownedFile(eslint, paths);
|
|
2373
2374
|
if (unowned !== null) {
|
|
@@ -2424,6 +2425,7 @@ export async function run(
|
|
|
2424
2425
|
.flatMap((r) => papersIn(r))
|
|
2425
2426
|
.map((d) => join(d, MAIN))
|
|
2426
2427
|
.filter((f) => existsSync(f)),
|
|
2428
|
+
bodies,
|
|
2427
2429
|
});
|
|
2428
2430
|
hooksLine(root, err, skillLinks);
|
|
2429
2431
|
// On stderr, so `--json` leaves stdout a clean array.
|
|
@@ -2455,7 +2457,14 @@ async function paperEslint(
|
|
|
2455
2457
|
/** ESLint's own per-rule timings on each result (`paperlint lint` reads them; the hook does not). */
|
|
2456
2458
|
readonly stats: boolean;
|
|
2457
2459
|
},
|
|
2458
|
-
): Promise<
|
|
2460
|
+
): Promise<
|
|
2461
|
+
Parsed<{
|
|
2462
|
+
eslint: ESLint;
|
|
2463
|
+
opts: PaperlintConfig;
|
|
2464
|
+
/** The body files handed to ESLint, read from each paper's record BEFORE the run (`--fix` may change them). */
|
|
2465
|
+
bodies: readonly PaperBody[];
|
|
2466
|
+
}>
|
|
2467
|
+
> {
|
|
2459
2468
|
// The order, most general first so the most specific wins (ESLint: a later block wins): each
|
|
2460
2469
|
// paper's venue preset → the root paperlint.json → the paper's own paperlint.json.
|
|
2461
2470
|
const papers = paperRuleBlocks(paths);
|
|
@@ -2491,7 +2500,7 @@ async function paperEslint(
|
|
|
2491
2500
|
fix,
|
|
2492
2501
|
stats,
|
|
2493
2502
|
});
|
|
2494
|
-
return { ok: true, value: { eslint, opts } };
|
|
2503
|
+
return { ok: true, value: { eslint, opts, bodies } };
|
|
2495
2504
|
}
|
|
2496
2505
|
|
|
2497
2506
|
/**
|
|
@@ -2635,6 +2644,7 @@ async function reportLint(
|
|
|
2635
2644
|
where,
|
|
2636
2645
|
opts,
|
|
2637
2646
|
projectPapers,
|
|
2647
|
+
bodies,
|
|
2638
2648
|
}: {
|
|
2639
2649
|
a: Args;
|
|
2640
2650
|
log: typeof console.log;
|
|
@@ -2642,12 +2652,15 @@ async function reportLint(
|
|
|
2642
2652
|
where: string;
|
|
2643
2653
|
opts: PaperlintConfig;
|
|
2644
2654
|
projectPapers: readonly string[];
|
|
2655
|
+
/** The body files handed to ESLint, as read before the run. */
|
|
2656
|
+
bodies: readonly PaperBody[];
|
|
2645
2657
|
},
|
|
2646
2658
|
): Promise<number> {
|
|
2647
2659
|
const silent = await silentOptionalRules(
|
|
2648
2660
|
eslint,
|
|
2649
2661
|
[...results.map((r) => r.filePath), ...projectPapers],
|
|
2650
2662
|
opts,
|
|
2663
|
+
bodyFilesOf(bodies),
|
|
2651
2664
|
);
|
|
2652
2665
|
if (silent.length > 0) {
|
|
2653
2666
|
err(
|
|
@@ -129,6 +129,17 @@ describe("paper/folder-venue-leftover — the folder names another venue", () =>
|
|
|
129
129
|
});
|
|
130
130
|
});
|
|
131
131
|
|
|
132
|
+
describe("paper/folder-venue-leftover — FSE is named by its edition", () => {
|
|
133
|
+
it("«fse-2027-…» is reported; a folder about FSE papers is not", () => {
|
|
134
|
+
expect(
|
|
135
|
+
lint("fse-2027-flaky", AIDC).map(
|
|
136
|
+
(r) => /names the venue (.*?), and/u.exec(r.message)?.[1],
|
|
137
|
+
),
|
|
138
|
+
).toEqual(["FSE 2027"]);
|
|
139
|
+
expect(lint("fse-replication", AIDC)).toEqual([]);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
|
|
132
143
|
describe("paper/folder-venue-leftover — a workshop's parent conference", () => {
|
|
133
144
|
it("🔴 in another venue's paper it is reported once, as itself", () => {
|
|
134
145
|
const named = (folder: string) =>
|
package/src/lint-fix.test.ts
CHANGED
|
@@ -59,9 +59,12 @@ const ruleIds = (stdout: string): string[] =>
|
|
|
59
59
|
r.messages.map((m) => m.ruleId ?? "(fatal)"),
|
|
60
60
|
);
|
|
61
61
|
|
|
62
|
+
/** The writing set on for every paper: the typography rules `--fix` rewrites are in it. */
|
|
63
|
+
const WRITING = { rules: { "paperlint:writing": "warn" } };
|
|
64
|
+
|
|
62
65
|
describe("paperlint lint --fix", () => {
|
|
63
66
|
it("🔴 three `§` and a bare decimal → --fix → zero findings, and the file says Section", async () => {
|
|
64
|
-
const root = project(
|
|
67
|
+
const root = project(WRITING);
|
|
65
68
|
const before = ruleIds((await lint(root)).out);
|
|
66
69
|
expect(before.filter((r) => r === "paper/section-word")).toHaveLength(3);
|
|
67
70
|
expect(before).toContain("paper/leading-zero");
|
|
@@ -74,12 +77,22 @@ describe("paperlint lint --fix", () => {
|
|
|
74
77
|
});
|
|
75
78
|
|
|
76
79
|
it("without --fix nothing is written", async () => {
|
|
77
|
-
const root = project(
|
|
80
|
+
const root = project(WRITING);
|
|
78
81
|
await lint(root);
|
|
79
82
|
expect(readFileSync(join(root, "papers/a/paper.tex"), "utf8")).toMatch(
|
|
80
83
|
/§5/,
|
|
81
84
|
);
|
|
82
85
|
});
|
|
86
|
+
|
|
87
|
+
it("🔴 without the writing set, the same paper gets no typography finding and --fix writes nothing", async () => {
|
|
88
|
+
const root = project({});
|
|
89
|
+
const ids = ruleIds((await lint(root, ["--fix"])).out);
|
|
90
|
+
expect(ids).not.toContain("paper/section-word");
|
|
91
|
+
expect(ids).not.toContain("paper/leading-zero");
|
|
92
|
+
expect(readFileSync(join(root, "papers/a/paper.tex"), "utf8")).toBe(
|
|
93
|
+
PAPER("See §5, §6 and §7; $p < .05$."),
|
|
94
|
+
);
|
|
95
|
+
});
|
|
83
96
|
});
|
|
84
97
|
|
|
85
98
|
describe("sibling cards: `read:` is required, from the package's own schema", () => {
|
|
@@ -55,6 +55,10 @@ function project(
|
|
|
55
55
|
dirs.push(root);
|
|
56
56
|
const all: Record<string, string> = {
|
|
57
57
|
"package.json": JSON.stringify({ name: "c", private: true }),
|
|
58
|
+
// The typography rules these cases read are opt-in, in the writing set: on for every paper.
|
|
59
|
+
"paperlint.json": JSON.stringify({
|
|
60
|
+
rules: { "paperlint:writing": "warn" },
|
|
61
|
+
}),
|
|
58
62
|
"papers/a/PIPELINE-STATUS.md": "---\nstages: []\n---\n",
|
|
59
63
|
"papers/a/paper.tex": doc(
|
|
60
64
|
"{article}",
|
|
@@ -215,11 +219,68 @@ describe("a built paper whose files are clean", () => {
|
|
|
215
219
|
});
|
|
216
220
|
expect({ code, out }).toEqual({
|
|
217
221
|
code: 0,
|
|
218
|
-
|
|
222
|
+
// The root file that turns the writing set on is named first, as every found config is.
|
|
223
|
+
out: ["config: paperlint.json", "✓ 3 file(s) checked, no findings"],
|
|
219
224
|
});
|
|
220
225
|
});
|
|
221
226
|
});
|
|
222
227
|
|
|
228
|
+
describe("an opt-in rule turned on for a paper's body files only", () => {
|
|
229
|
+
/** `paper/leading-zero` on for `files` alone, in the root file: no writing set. */
|
|
230
|
+
const onlyFor = (files: string[]) => ({
|
|
231
|
+
"paperlint.json": JSON.stringify({
|
|
232
|
+
rules: [{ files, rules: { "paper/leading-zero": "warn" } }],
|
|
233
|
+
}),
|
|
234
|
+
});
|
|
235
|
+
const lintCode = async (root: string, args: string[] = []) => {
|
|
236
|
+
const out: string[] = [];
|
|
237
|
+
const err: string[] = [];
|
|
238
|
+
const code = await run(["lint", "--json", ...args], {
|
|
239
|
+
cwd: root,
|
|
240
|
+
log: (s: string) => out.push(s),
|
|
241
|
+
err: (s: string) => err.push(s),
|
|
242
|
+
});
|
|
243
|
+
return { code, out: out.join("\n"), err: err.join("\n") };
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
it("🔴 reaches the included file it runs on: the run reports there, and is not refused as a rule no paper gets", async () => {
|
|
247
|
+
const r = await lintCode(project(onlyFor(["papers/a/sections/**/*.tex"])));
|
|
248
|
+
expect(r.err).not.toMatch(/no paper\.tex of the project gets it/);
|
|
249
|
+
expect(r.code).toBe(0);
|
|
250
|
+
const intro = lintReport(r.out).find((f) =>
|
|
251
|
+
f.filePath.endsWith("papers/a/sections/intro.tex"),
|
|
252
|
+
);
|
|
253
|
+
expect(intro?.messages.map((m) => m.ruleId)).toEqual([
|
|
254
|
+
"paper/leading-zero",
|
|
255
|
+
]);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it("🔴 with --fix too: the fix rewrites the included file, which leaves the build's record behind it, and the run is still not refused", async () => {
|
|
259
|
+
const root = project(onlyFor(["papers/a/sections/**/*.tex"]));
|
|
260
|
+
const r = await lintCode(root, ["--fix"]);
|
|
261
|
+
expect(r.err).not.toMatch(/no paper\.tex of the project gets it/);
|
|
262
|
+
expect(r.code).toBe(0);
|
|
263
|
+
expect(lintReport(r.out).length).toBeGreaterThan(0);
|
|
264
|
+
expect(
|
|
265
|
+
readFileSync(join(root, "papers/a/sections/intro.tex"), "utf8"),
|
|
266
|
+
).toBe(INTRO.replace(".05", "0.05"));
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
it.each([[[]], [["--fix"]]])(
|
|
270
|
+
"a glob that reaches no file of any paper still fails the run (args %j)",
|
|
271
|
+
async (args) => {
|
|
272
|
+
const r = await lintCode(
|
|
273
|
+
project(onlyFor(["papers/a/nothing/**/*.tex"])),
|
|
274
|
+
args,
|
|
275
|
+
);
|
|
276
|
+
expect(r.code).toBe(1);
|
|
277
|
+
expect(r.err).toMatch(
|
|
278
|
+
/^paper\/leading-zero is turned on in "rules", but no paper\.tex of the project gets it/m,
|
|
279
|
+
);
|
|
280
|
+
},
|
|
281
|
+
);
|
|
282
|
+
});
|
|
283
|
+
|
|
223
284
|
describe("a paper whose record is missing, stale or silent about a file", () => {
|
|
224
285
|
it("🔴 a paper no build has recorded is paper.tex alone: its includes are not linted, and paper/sources-fresh says so", async () => {
|
|
225
286
|
const { byFile } = await lint(project({}, null));
|
|
@@ -302,7 +302,7 @@ describe("paperlint lint — the paper over its preset, and the project's own pr
|
|
|
302
302
|
const r = await lint(root);
|
|
303
303
|
expect(r.code).toBe(1);
|
|
304
304
|
expect(r.out).toMatch(
|
|
305
|
-
/acm-sigconf, agent, agenticdev, agentverify, aidc, aisec, ase, ccs, icse, ieee-conference, msr, nlbse, realm, sp/,
|
|
305
|
+
/acm-acmsmall, acm-sigconf, agent, agenticdev, agentverify, aidc, aisec, ase, ccs, fse, icse, ieee-conference, msr, nlbse, realm, sp/,
|
|
306
306
|
);
|
|
307
307
|
});
|
|
308
308
|
});
|
|
@@ -86,6 +86,7 @@ describe("the shipped cards", () => {
|
|
|
86
86
|
const results = await eslint().lintFiles([join(P, "*.md")]);
|
|
87
87
|
// Guards: a glob that matched nothing lints nothing and reports clean.
|
|
88
88
|
expect(results.map((r) => r.filePath.slice(P.length + 1)).sort()).toEqual([
|
|
89
|
+
"acm-acmsmall.md",
|
|
89
90
|
"acm-sigconf.md",
|
|
90
91
|
"agent.md",
|
|
91
92
|
"agenticdev.md",
|
|
@@ -94,6 +95,7 @@ describe("the shipped cards", () => {
|
|
|
94
95
|
"aisec.md",
|
|
95
96
|
"ase.md",
|
|
96
97
|
"ccs.md",
|
|
98
|
+
"fse.md",
|
|
97
99
|
"icse.md",
|
|
98
100
|
"ieee-conference.md",
|
|
99
101
|
"msr.md",
|