paperlint 20.5.0 → 20.6.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.map +1 -1
- package/dist/adapters/venue-corpus/index.js +9 -2
- package/dist/adapters/venue-corpus/index.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +11 -8
- package/dist/cli.js.map +1 -1
- package/dist/corpus-json-rules.d.ts +6 -0
- package/dist/corpus-json-rules.d.ts.map +1 -0
- package/dist/corpus-json-rules.js +15 -0
- package/dist/corpus-json-rules.js.map +1 -0
- package/dist/corpus-licence-rule.d.ts +27 -0
- package/dist/corpus-licence-rule.d.ts.map +1 -0
- package/dist/corpus-licence-rule.js +78 -0
- package/dist/corpus-licence-rule.js.map +1 -0
- package/dist/corpus-record-rule.d.ts +2 -0
- package/dist/corpus-record-rule.d.ts.map +1 -1
- package/dist/corpus-record-rule.js +4 -2
- package/dist/corpus-record-rule.js.map +1 -1
- package/dist/domain/corpus-licence.d.ts +23 -0
- package/dist/domain/corpus-licence.d.ts.map +1 -0
- package/dist/domain/corpus-licence.js +50 -0
- package/dist/domain/corpus-licence.js.map +1 -0
- package/dist/domain/corpus-record.d.ts +8 -0
- package/dist/domain/corpus-record.d.ts.map +1 -1
- package/dist/domain/corpus-record.js +11 -9
- package/dist/domain/corpus-record.js.map +1 -1
- package/dist/domain/edition.d.ts +3 -1
- package/dist/domain/edition.d.ts.map +1 -1
- package/dist/domain/edition.js +6 -2
- package/dist/domain/edition.js.map +1 -1
- package/dist/domain/licence.d.ts +1 -1
- package/dist/domain/licence.d.ts.map +1 -1
- package/dist/domain/licence.js +2 -2
- package/dist/domain/licence.js.map +1 -1
- package/dist/skill-chunks/chunk-QPWFSYJG.js +17 -0
- package/dist/skill-chunks/{chunk-6YEM4VDI.js → chunk-WYQTXKNM.js} +1 -1
- package/docs/design/venue-corpus.md +16 -16
- package/docs/optional-rules.md +11 -10
- package/docs/rules/corpus/licence.md +125 -0
- package/docs/rules/corpus/record.md +6 -3
- package/docs/rules.md +2 -1
- package/docs/venues.md +8 -8
- package/package.json +1 -1
- package/skills/argument-arc/scripts/headings.js +2 -2
- package/skills/cold-read-diff/scripts/cold-read.js +5 -5
- package/skills/paper-pipeline/scripts/extract-ref-facts.js +3 -3
- package/skills/pc-panel-review/scripts/prior-reviews.js +2 -1
- package/skills/study-accepted-papers/SKILL.md +4 -3
- package/skills/study-accepted-papers/SKILL.md.spec.ts +3 -2
- package/skills/study-accepted-papers/papers.schema.json +2 -2
- package/skills/study-accepted-papers/scripts/corpus-licences.js +15 -3
- package/skills/study-accepted-papers/scripts/corpus-licences.test.ts +1 -1
- package/skills/verify-citations/scripts/bib-authors.js +3 -3
- package/skills/verify-citations/scripts/verify-cites.js +3 -3
- package/src/adapters/venue-corpus/index.test.ts +25 -0
- package/src/adapters/venue-corpus/index.ts +16 -2
- package/src/cli.ts +13 -11
- package/src/corpus-json-rules.ts +22 -0
- package/src/corpus-licence-rule.test.ts +217 -0
- package/src/corpus-licence-rule.ts +94 -0
- package/src/corpus-record-rule.test.ts +12 -0
- package/src/corpus-record-rule.ts +6 -2
- package/src/domain/corpus-licence.test.ts +128 -0
- package/src/domain/corpus-licence.ts +99 -0
- package/src/domain/corpus-record.test.ts +7 -1
- package/src/domain/corpus-record.ts +26 -9
- package/src/domain/edition.ts +8 -2
- package/src/domain/licence.test.ts +1 -1
- package/src/domain/licence.ts +2 -2
- package/src/rule-cases.test.ts +2 -44
- package/src/rule-id-shape.test.ts +42 -0
- package/dist/skill-chunks/{chunk-CXAGKT44.js → chunk-EDHTB7KT.js} +4 -4
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `corpus/licence` — the licence of each copy a venue corpus stores permits keeping it
|
|
3
|
+
* (docs/design/venue-corpus.md, decisions 3 and 4; docs/rules/corpus/licence.md). OFF by default and
|
|
4
|
+
* in no rule set: the same files are legal in a private repository and illegal in a public one, and
|
|
5
|
+
* the rule cannot tell which it is in. What is judged is `src/domain/corpus-licence.ts`, which asks
|
|
6
|
+
* the table in `src/domain/licence.ts`; this file reads the record through the codec, reads the
|
|
7
|
+
* rule's one option, and reports.
|
|
8
|
+
*
|
|
9
|
+
* ── WHERE IT REPORTS ─────────────────────────────────────────────────────────────
|
|
10
|
+
* On `<papers-root>/venues/<venue>/papers.json`, at the `stored` of the copy each finding is about
|
|
11
|
+
* (the same location technique as `corpus/record`, `spanAt`). A record that does not parse has
|
|
12
|
+
* findings of `corpus/record`'s and none of this rule's.
|
|
13
|
+
*
|
|
14
|
+
* ── THE OPTION ───────────────────────────────────────────────────────────────────
|
|
15
|
+
* `"corpus/licence": ["warn", { "nonCommercial": true }]` in the root `paperlint.json`: the project
|
|
16
|
+
* declares itself non-commercial, which makes a non-commercial licence permit storing. The
|
|
17
|
+
* default is false: paperlint does not assume it.
|
|
18
|
+
*/
|
|
19
|
+
import { spanAt } from "./corpus-record-rule.js";
|
|
20
|
+
import { judgeLicences, licenceMessage, } from "./domain/corpus-licence.js";
|
|
21
|
+
import { rulePageUrl } from "./venue-rules.js";
|
|
22
|
+
/** The option, as ESLint's schema validated it: `nonCommercial` is a boolean or absent. */
|
|
23
|
+
const nonCommercial = (options) => {
|
|
24
|
+
const [first] = options;
|
|
25
|
+
return (typeof first === "object" &&
|
|
26
|
+
first !== null &&
|
|
27
|
+
"nonCommercial" in first &&
|
|
28
|
+
first.nonCommercial === true);
|
|
29
|
+
};
|
|
30
|
+
const META = {
|
|
31
|
+
type: "suggestion",
|
|
32
|
+
docs: {
|
|
33
|
+
description: "each copy a venue corpus stores has a licence that permits keeping that file (opt-in: the same files are legal in a private repository and illegal in a public one)",
|
|
34
|
+
url: rulePageUrl("corpus/licence"),
|
|
35
|
+
},
|
|
36
|
+
schema: [
|
|
37
|
+
{
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: { nonCommercial: { type: "boolean" } },
|
|
40
|
+
additionalProperties: false,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
// One id per kind of refusal, each with the whole text of `licenceMessage`.
|
|
44
|
+
messages: {
|
|
45
|
+
"not-read": "{{text}}",
|
|
46
|
+
unlisted: "{{text}}",
|
|
47
|
+
forbidden: "{{text}}",
|
|
48
|
+
"non-commercial-only": "{{text}}",
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
/** The rule, reading each record through `deps.codec`. */
|
|
52
|
+
export function corpusLicenceRules(deps) {
|
|
53
|
+
return {
|
|
54
|
+
licence: {
|
|
55
|
+
meta: META,
|
|
56
|
+
create(context) {
|
|
57
|
+
return {
|
|
58
|
+
Document() {
|
|
59
|
+
const { text, ast } = context.sourceCode;
|
|
60
|
+
const record = deps.codec.parse(text);
|
|
61
|
+
if (!record.ok)
|
|
62
|
+
return;
|
|
63
|
+
judgeLicences(record.corpus, {
|
|
64
|
+
nonCommercial: nonCommercial(context.options),
|
|
65
|
+
}).forEach((f) => {
|
|
66
|
+
context.report({
|
|
67
|
+
loc: spanAt(ast, f.at),
|
|
68
|
+
messageId: f.refusal.kind,
|
|
69
|
+
data: { text: licenceMessage(f) },
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=corpus-licence-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corpus-licence-rule.js","sourceRoot":"","sources":["../src/corpus-licence-rule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,MAAM,EAAuB,MAAM,yBAAyB,CAAC;AACtE,OAAO,EACL,aAAa,EACb,cAAc,GAEf,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAO/C,2FAA2F;AAC3F,MAAM,aAAa,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;gCACb,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;gCACtB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI;gCACzB,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE;6BAClC,CAAC,CAAC;wBACL,CAAC,CAAC,CAAC;oBACL,CAAC;iBACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -39,6 +39,8 @@ interface JsonDocument {
|
|
|
39
39
|
/** What the rule uses of ESLint's context on a JSON file. */
|
|
40
40
|
export interface JsonRuleContext {
|
|
41
41
|
readonly filename: string;
|
|
42
|
+
/** The options the rule was configured with: what follows its severity in `["warn", { … }]`. */
|
|
43
|
+
readonly options: readonly unknown[];
|
|
42
44
|
readonly sourceCode: {
|
|
43
45
|
readonly text: string;
|
|
44
46
|
readonly ast: JsonDocument;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corpus-record-rule.d.ts","sourceRoot":"","sources":["../src/corpus-record-rule.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,gCAAgC;AAChC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;CAClC;AAED,UAAU,QAAQ;IAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,8DAA8D;AAC9D,UAAU,IAAI;IACZ,QAAQ,CAAC,KAAK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BAAyB,EAAE,QAAQ,CAC9C,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,CACF,CAAC"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* folder without `papers.json` has no file to report on, and this rule says nothing about it:
|
|
13
13
|
* `corpus/allowed-files-only` reports it on the root `paperlint.json` (src/corpus-layout-rule.ts).
|
|
14
14
|
*/
|
|
15
|
-
import { dirname, join } from "node:path";
|
|
15
|
+
import { basename, dirname, join } from "node:path";
|
|
16
16
|
import { callerPath } from "./caller-path.js";
|
|
17
17
|
import { corpusMessage, judgeCorpus, } from "./domain/corpus-record.js";
|
|
18
18
|
import { rulePageUrl } from "./venue-rules.js";
|
|
@@ -38,6 +38,7 @@ const visible = (dir, deps) => deps
|
|
|
38
38
|
.toSorted((a, b) => a.localeCompare(b));
|
|
39
39
|
/** The findings about the corpus whose `papers.json` is `file`, holding `text`. */
|
|
40
40
|
const findingsFor = (file, text, deps) => judgeCorpus({
|
|
41
|
+
folder: basename(dirname(file)),
|
|
41
42
|
record: deps.codec.parse(text),
|
|
42
43
|
stored: {
|
|
43
44
|
pdf: visible(join(dirname(file), "pdf"), deps),
|
|
@@ -47,13 +48,14 @@ const findingsFor = (file, text, deps) => judgeCorpus({
|
|
|
47
48
|
const META = {
|
|
48
49
|
type: "suggestion",
|
|
49
50
|
docs: {
|
|
50
|
-
description: "a venue corpus's papers.json is a record, every copy stored in pdf/ and text/ is claimed by one copy in it, and every claimed file is there",
|
|
51
|
+
description: "a venue corpus's papers.json is a record that names its own folder as its venue, every copy stored in pdf/ and text/ is claimed by one copy in it, and every claimed file is there",
|
|
51
52
|
url: rulePageUrl("corpus/record"),
|
|
52
53
|
},
|
|
53
54
|
schema: [],
|
|
54
55
|
// One id per finding, each with the whole text of `corpusMessage`.
|
|
55
56
|
messages: Object.fromEntries([
|
|
56
57
|
"unparsed",
|
|
58
|
+
"venue",
|
|
57
59
|
"unclaimed",
|
|
58
60
|
"missing",
|
|
59
61
|
"twice",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corpus-record-rule.js","sourceRoot":"","sources":["../src/corpus-record-rule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"corpus-record-rule.js","sourceRoot":"","sources":["../src/corpus-record-rule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,aAAa,EACb,WAAW,GAEZ,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA+D/C;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,EAAQ,EAAE,OAAwB,EAAQ,EAAE;IACxD,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ;QACzB,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC;QAC9B,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC;IAClE,OAAO,IAAI,KAAK,SAAS;QACvB,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE;QAC7B,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;AAC1C,CAAC,CAAC;AAEF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAAiB,EAAE,IAAgB,EAAQ,EAAE,CAClE,IAAI,C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AE,MAAM,CAAC,WAAW,CAExB;QACE,UAAU;QACV,OAAO;QACP,WAAW;QACX,SAAS;QACT,OAAO;KAEV,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,CAChC;CACF,CAAC;AAEF,mDAAmD;AACnD,MAAM,UAAU,iBAAiB,CAC/B,IAAsB;IAEtB,OAAO;QACL,MAAM,EAAE;YACN,IAAI,EAAE,IAAI;YACV,MAAM,CAAC,OAAO;gBACZ,OAAO;oBACL,QAAQ;wBACN,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;wBACzC,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;4BACtD,OAAO,CAAC,MAAM,CAAC;gCACb,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;gCACtB,SAAS,EAAE,CAAC,CAAC,IAAI;gCACjB,IAAI,EAAE,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE;6BACjC,CAAC,CAAC;wBACL,CAAC,CAAC,CAAC;oBACL,CAAC;iBACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED,sDAAsD;AACtD,MAAM,CAAC,MAAM,yBAAyB,GAElC,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type LicenceSettings, type Permission, type StoredKind } from "./licence.ts";
|
|
2
|
+
import type { RecordPath, VenueCorpus } from "./venue-corpus.ts";
|
|
3
|
+
/** What stands against storing one kind of one copy: any permission but the one that allows it. */
|
|
4
|
+
export type Refusal = Exclude<Permission, {
|
|
5
|
+
readonly kind: "permitted";
|
|
6
|
+
}>;
|
|
7
|
+
/**
|
|
8
|
+
* The kinds of one copy that one refusal stands against, with `at`, the copy's `stored` in `papers.json`.
|
|
9
|
+
* A copy whose kinds are refused for the same reason is one finding naming them all; ND, which
|
|
10
|
+
* refuses one kind and not the other, gives one finding for that kind.
|
|
11
|
+
*/
|
|
12
|
+
export interface LicenceFinding {
|
|
13
|
+
readonly at: RecordPath;
|
|
14
|
+
readonly key: string;
|
|
15
|
+
readonly licence: string;
|
|
16
|
+
readonly stored: readonly [StoredKind, ...StoredKind[]];
|
|
17
|
+
readonly refusal: Refusal;
|
|
18
|
+
}
|
|
19
|
+
/** Every refusal of every copy, with the stored kinds it stands against, in the record's order. */
|
|
20
|
+
export declare const judgeLicences: (corpus: VenueCorpus, settings: Readonly<LicenceSettings>) => readonly LicenceFinding[];
|
|
21
|
+
/** The text of a finding: what is wrong, then what to do. */
|
|
22
|
+
export declare function licenceMessage(f: LicenceFinding): string;
|
|
23
|
+
//# sourceMappingURL=corpus-licence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corpus-licence.d.ts","sourceRoot":"","sources":["../../src/domain/corpus-licence.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAQ,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEvE,mGAAmG;AACnG,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,UAAU,EAAE,GAAG,UAAU,EAAE,CAAC,CAAC;IACxD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AA6BD,mGAAmG;AACnG,eAAO,MAAM,aAAa,GACxB,QAAQ,WAAW,EACnB,UAAU,QAAQ,CAAC,eAAe,CAAC,KAClC,SAAS,cAAc,EAUvB,CAAC;AAOJ,6DAA6D;AAC7D,wBAAgB,cAAc,CAAC,CAAC,EAAE,cAAc,GAAG,MAAM,CAiBxD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `corpus/licence`'s judgement of one venue corpus (docs/design/venue-corpus.md, decisions 3 and 4;
|
|
3
|
+
* docs/rules/corpus/licence.md): whether the licence of each copy permits keeping each kind it
|
|
4
|
+
* stores. Pure: the record, already parsed by the codec, and the one setting in; the findings out.
|
|
5
|
+
* What a licence permits is the table in `licence.ts`, asked here and never copied.
|
|
6
|
+
*/
|
|
7
|
+
import { groupBy } from "remeda";
|
|
8
|
+
import { storedAt } from "./corpus-record.js";
|
|
9
|
+
import { permits, } from "./licence.js";
|
|
10
|
+
/** The stored kinds of `copy` its licence refuses, in its `stored` order. */
|
|
11
|
+
const refusedKinds = (copy, settings) => copy.stored.flatMap((stored) => {
|
|
12
|
+
const refusal = permits(copy.licence.id, stored, settings);
|
|
13
|
+
return refusal.kind === "permitted" ? [] : [{ stored, refusal }];
|
|
14
|
+
});
|
|
15
|
+
/** The refusals of one copy, one per reason (two refusals that print the same message are one), each with its kinds. */
|
|
16
|
+
const byReason = (refused) => Object.values(groupBy(refused, (r) => JSON.stringify(r.refusal))).map(([first, ...rest]) => ({
|
|
17
|
+
stored: [first.stored, ...rest.map((r) => r.stored)],
|
|
18
|
+
refusal: first.refusal,
|
|
19
|
+
}));
|
|
20
|
+
/** Every refusal of every copy, with the stored kinds it stands against, in the record's order. */
|
|
21
|
+
export const judgeLicences = (corpus, settings) => corpus.papers.flatMap((p, paper) => p.copies.flatMap((c, copy) => byReason(refusedKinds(c, settings)).map((r) => ({
|
|
22
|
+
at: storedAt(paper, [copy]),
|
|
23
|
+
key: p.key,
|
|
24
|
+
licence: c.licence.id,
|
|
25
|
+
...r,
|
|
26
|
+
}))));
|
|
27
|
+
const FILE = {
|
|
28
|
+
pdf: "pdf/<key>.pdf",
|
|
29
|
+
text: "text/<key>.txt",
|
|
30
|
+
};
|
|
31
|
+
/** The text of a finding: what is wrong, then what to do. */
|
|
32
|
+
export function licenceMessage(f) {
|
|
33
|
+
const kinds = f.stored.map((k) => `\`${k}\``).join(" and ");
|
|
34
|
+
const files = f.stored.map((k) => `\`${FILE[k]}\``).join(", ");
|
|
35
|
+
const quoted = f.stored.map((k) => `\`"${k}"\``).join(" and ");
|
|
36
|
+
const it = f.stored.length === 1 ? "it" : "them";
|
|
37
|
+
const what = `a copy of \`${f.key}\` stores ${kinds} (${files})`;
|
|
38
|
+
const remove = `remove ${f.stored.length === 1 ? "the file" : "the files"} and ${quoted} from that copy's \`stored\`, and keep the paper's ids`;
|
|
39
|
+
switch (f.refusal.kind) {
|
|
40
|
+
case "not-read":
|
|
41
|
+
return `${what}, and no licence was read for that copy (\`NOASSERTION\`). What to do: record the licence and where it was read (\`licence.id\`, \`read_from\`, \`read_on\`), or ${remove}`;
|
|
42
|
+
case "unlisted":
|
|
43
|
+
return `${what} under \`${f.refusal.id}\`, and the licence table does not list that id, so it permits nothing. What to do: correct the id if it is misspelt; otherwise ${remove}`;
|
|
44
|
+
case "forbidden":
|
|
45
|
+
return `${what} under \`${f.licence}\`, which does not permit ${it}: ${f.refusal.why}. What to do: ${remove}`;
|
|
46
|
+
case "non-commercial-only":
|
|
47
|
+
return `${what} under \`${f.licence}\`, which permits ${it} only in a non-commercial project, and this one has not declared itself one. What to do: if it is one, set \`"corpus/licence": ["warn", { "nonCommercial": true }]\` in the root \`paperlint.json\`; otherwise ${remove}`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=corpus-licence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corpus-licence.js","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AAG,aAAa,KAAK,KAAK,KAAK,GAAG,CAAC;IACjE,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,QAAQ,MAAM,wDAAwD,CAAC;IAChJ,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,UAAU;YACb,OAAO,GAAG,IAAI,oKAAoK,MAAM,EAAE,CAAC;QAC7L,KAAK,UAAU;YACb,OAAO,GAAG,IAAI,YAAY,CAAC,CAAC,OAAO,CAAC,EAAE,mIAAmI,MAAM,EAAE,CAAC;QACpL,KAAK,WAAW;YACd,OAAO,GAAG,IAAI,YAAY,CAAC,CAAC,OAAO,6BAA6B,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,iBAAiB,MAAM,EAAE,CAAC;QAChH,KAAK,qBAAqB;YACxB,OAAO,GAAG,IAAI,YAAY,CAAC,CAAC,OAAO,qBAAqB,EAAE,kNAAkN,MAAM,EAAE,CAAC;IACzR,CAAC;AACH,CAAC"}
|
|
@@ -13,6 +13,8 @@ import { type ParsedCorpus, type RecordPath } from "./venue-corpus.ts";
|
|
|
13
13
|
export declare const CORPORA_DIR = "venues";
|
|
14
14
|
/** What the rule reads of one corpus folder. */
|
|
15
15
|
export interface CorpusFolder {
|
|
16
|
+
/** The corpus folder's name: the venue preset's series, which the record's `venue` must repeat. */
|
|
17
|
+
readonly folder: string;
|
|
16
18
|
/** `papers.json`, as the codec parsed it. */
|
|
17
19
|
readonly record: ParsedCorpus;
|
|
18
20
|
/** The names in `pdf/` and in `text/`, hidden ones left out; none when the folder is absent. */
|
|
@@ -27,6 +29,10 @@ export type CorpusFinding = {
|
|
|
27
29
|
} & ({
|
|
28
30
|
readonly kind: "unparsed";
|
|
29
31
|
readonly message: string;
|
|
32
|
+
} | {
|
|
33
|
+
readonly kind: "venue";
|
|
34
|
+
readonly venue: string;
|
|
35
|
+
readonly folder: string;
|
|
30
36
|
} | {
|
|
31
37
|
readonly kind: "unclaimed";
|
|
32
38
|
readonly file: string;
|
|
@@ -44,6 +50,8 @@ export type CorpusFinding = {
|
|
|
44
50
|
});
|
|
45
51
|
/** The key a stored file's name belongs to, or null when the name is not one a copy can store. */
|
|
46
52
|
export declare function storedKey(kind: StoredKind, name: string): string | null;
|
|
53
|
+
/** The `stored` of a paper's copy (`copy` holds its index), as a path. */
|
|
54
|
+
export declare const storedAt: (paper: number, copy: readonly number[]) => RecordPath;
|
|
47
55
|
/** Every finding about one corpus folder; none for a corpus whose record accounts for each copy. */
|
|
48
56
|
export declare const judgeCorpus: (folder: CorpusFolder) => readonly CorpusFinding[];
|
|
49
57
|
/** The text of a finding: what is wrong, then what to do. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corpus-record.d.ts","sourceRoot":"","sources":["../../src/domain/corpus-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,UAAU,EAEhB,MAAM,mBAAmB,CAAC;AAE3B,mEAAmE;AACnE,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC,gDAAgD;AAChD,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,gGAAgG;IAChG,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;CAClE;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAA;CAAE,GAAG,CACtD;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvD;IACE,QAAQ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C,EAAE,aAAa,GAAG,MAAM,CAatD"}
|
|
@@ -37,13 +37,7 @@ const expectedFile = (kind, key) => `${kind}/${key}.${EXTENSION[kind]}`;
|
|
|
37
37
|
/** The indexes of `p`'s copies that store `kind`. */
|
|
38
38
|
const storing = (p, kind) => p.copies.flatMap((c, i) => (c.stored.includes(kind) ? [i] : []));
|
|
39
39
|
/** The `stored` of a paper's copy (`copy` holds its index), as a path. */
|
|
40
|
-
const storedAt = (paper, copy) => [
|
|
41
|
-
"papers",
|
|
42
|
-
paper,
|
|
43
|
-
"copies",
|
|
44
|
-
...copy,
|
|
45
|
-
"stored",
|
|
46
|
-
];
|
|
40
|
+
export const storedAt = (paper, copy) => ["papers", paper, "copies", ...copy, "stored"];
|
|
47
41
|
/** A paper's kind stored by more than one of its copies, reported at the second one. */
|
|
48
42
|
const twice = (claims) => claims
|
|
49
43
|
.filter((c) => c.copies.length > 1)
|
|
@@ -80,8 +74,13 @@ const missing = (claims, stored) => claims
|
|
|
80
74
|
stored: c.kind,
|
|
81
75
|
file: expectedFile(c.kind, c.key),
|
|
82
76
|
}));
|
|
77
|
+
/** The record's `venue`, when it is not the name of the folder it stands in. */
|
|
78
|
+
const venueName = (corpus, folder) => corpus.venue === folder
|
|
79
|
+
? []
|
|
80
|
+
: [{ kind: "venue", at: ["venue"], venue: corpus.venue, folder }];
|
|
83
81
|
/** What a read record says about the folder. */
|
|
84
|
-
function judgeRecord(corpus,
|
|
82
|
+
function judgeRecord(corpus, folder) {
|
|
83
|
+
const { stored } = folder;
|
|
85
84
|
const claims = STORED_KINDS.flatMap((kind) => corpus.papers.map((p, paper) => ({
|
|
86
85
|
kind,
|
|
87
86
|
key: p.key,
|
|
@@ -89,6 +88,7 @@ function judgeRecord(corpus, stored) {
|
|
|
89
88
|
copies: storing(p, kind),
|
|
90
89
|
})));
|
|
91
90
|
return [
|
|
91
|
+
...venueName(corpus, folder.folder),
|
|
92
92
|
...twice(claims),
|
|
93
93
|
...unclaimed(claims, stored),
|
|
94
94
|
...missing(claims, stored),
|
|
@@ -96,7 +96,7 @@ function judgeRecord(corpus, stored) {
|
|
|
96
96
|
}
|
|
97
97
|
/** Every finding about one corpus folder; none for a corpus whose record accounts for each copy. */
|
|
98
98
|
export const judgeCorpus = (folder) => folder.record.ok
|
|
99
|
-
? judgeRecord(folder.record.corpus, folder
|
|
99
|
+
? judgeRecord(folder.record.corpus, folder)
|
|
100
100
|
: folder.record.problems.map((p) => ({
|
|
101
101
|
kind: "unparsed",
|
|
102
102
|
at: p.path,
|
|
@@ -108,6 +108,8 @@ export function corpusMessage(f) {
|
|
|
108
108
|
switch (f.kind) {
|
|
109
109
|
case "unparsed":
|
|
110
110
|
return `\`${pathText(f.at)}\`: ${f.message}. What to do: correct the field; the fields are in the JSON Schema \`papers.schema.json\` that \`study-accepted-papers\` ships`;
|
|
111
|
+
case "venue":
|
|
112
|
+
return `the record says \`"venue": "${f.venue}"\`, and its folder is \`${f.folder}\`. What to do: rename the folder to \`${f.venue}\`, or correct the field to \`${f.folder}\``;
|
|
111
113
|
case "unclaimed":
|
|
112
114
|
return `\`${f.file}\` is stored, and no copy in \`${CORPUS_RECORD}\` claims it${f.key === null ? `: its name is not \`pdf/<key>.pdf\`, \`text/<key>.txt\` or \`text/<key>.<variant>.txt\`` : ` (no copy of the paper \`${f.key}\` lists it in \`stored\`)`}. What to do: record it under the copy it was fetched from, with \`fetched_from\`, its licence and where the licence was read; ${KEEP_IDS}`;
|
|
113
115
|
case "missing":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corpus-record.js","sourceRoot":"","sources":["../../src/domain/corpus-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,WAAW,EACX,QAAQ,GAKT,MAAM,mBAAmB,CAAC;AAE3B,mEAAmE;AACnE,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC;
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AC,CAAC,CAAC,yFAAyF,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,GAAG,4BAA4B,kIAAkI,QAAQ,EAAE,CAAC;QACzY,KAAK,SAAS;YACZ,OAAO,eAAe,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,MAAM,WAAW,aAAa,aAAa,CAAC,CAAC,IAAI,gEAAgE,CAAC,CAAC,MAAM,iCAAiC,CAAC;QACzM,KAAK,OAAO;YACV,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,MAAM,yEAAyE,CAAC,CAAC,MAAM,2FAA2F,CAAC;IACjQ,CAAC;AACH,CAAC"}
|
package/dist/domain/edition.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
/** A venue preset's id: a series
|
|
1
|
+
/** A venue preset's id: a series, then `-<year>`. */
|
|
2
2
|
export declare const EDITION_ID: RegExp;
|
|
3
|
+
/** A series id's shape, the part of an edition's id before its year; whether it ends in a year is `endsInYear`. */
|
|
4
|
+
export declare const SERIES_ID: RegExp;
|
|
3
5
|
/** An edition: its series and its year. */
|
|
4
6
|
export interface Edition {
|
|
5
7
|
readonly series: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edition.d.ts","sourceRoot":"","sources":["../../src/domain/edition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"edition.d.ts","sourceRoot":"","sources":["../../src/domain/edition.ts"],"names":[],"mappings":"AAkBA,qDAAqD;AACrD,eAAO,MAAM,UAAU,QAA4C,CAAC;AAEpE,mHAAmH;AACnH,eAAO,MAAM,SAAS,QAAiC,CAAC;AAExD,2CAA2C;AAC3C,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,6GAA6G;AAC7G,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAKpD;AAED,iGAAiG;AACjG,eAAO,MAAM,UAAU,GAAI,IAAI,MAAM,KAAG,OAA6B,CAAC;AAEtE,2GAA2G;AAC3G,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,MAAM,MAAM,GAAG,IAAI,KAAG,MACf,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,UAAU,GACrB,QAAQ,MAAM,EACd,SAAS,SAAS,MAAM,EAAE,KACzB,SAAS,MAAM,EAAuD,CAAC;AAE1E,qFAAqF;AACrF,eAAO,MAAM,aAAa,GACxB,GAAG,OAAO,EACV,SAAS,SAAS,MAAM,EAAE,KACzB,SAAS,MAAM,EAGG,CAAC;AAetB;;;GAGG;AACH,wBAAgB,SAAS,CACvB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAChC,MAAM,GAAG,IAAI,CAMf;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,WAAW,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,KACnE,SAAS,MAAM,EASb,CAAC"}
|
package/dist/domain/edition.js
CHANGED
|
@@ -12,8 +12,12 @@
|
|
|
12
12
|
* editions (`src/presets.ts`).
|
|
13
13
|
*/
|
|
14
14
|
import { sortBy } from "remeda";
|
|
15
|
-
/** A
|
|
16
|
-
|
|
15
|
+
/** A series: lowercase words and digits joined by hyphens (`icse`, `usenix-sec`). */
|
|
16
|
+
const SERIES = "[a-z0-9]+(?:-[a-z0-9]+)*";
|
|
17
|
+
/** A venue preset's id: a series, then `-<year>`. */
|
|
18
|
+
export const EDITION_ID = new RegExp(`^(${SERIES})-(\\d{4})$`, "u");
|
|
19
|
+
/** A series id's shape, the part of an edition's id before its year; whether it ends in a year is `endsInYear`. */
|
|
20
|
+
export const SERIES_ID = new RegExp(`^${SERIES}$`, "u");
|
|
17
21
|
/** The edition an id names, or null when the id ends in no year (a family, or a file of one's own). Pure. */
|
|
18
22
|
export function editionOf(id) {
|
|
19
23
|
const m = EDITION_ID.exec(id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edition.js","sourceRoot":"","sources":["../../src/domain/edition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,
|
|
1
|
+
{"version":3,"file":"edition.js","sourceRoot":"","sources":["../../src/domain/edition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,qFAAqF;AACrF,MAAM,MAAM,GAAG,0BAA0B,CAAC;AAE1C,qDAAqD;AACrD,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,KAAK,MAAM,aAAa,EAAE,GAAG,CAAC,CAAC;AAEpE,mHAAmH;AACnH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,IAAI,MAAM,GAAG,EAAE,GAAG,CAAC,CAAC;AAQxD,6GAA6G;AAC7G,MAAM,UAAU,SAAS,CAAC,EAAU;IAClC,MAAM,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9B,OAAO,CAAC,KAAK,IAAI;QACf,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACxE,CAAC;AAED,iGAAiG;AACjG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAU,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AC;AAEJ;;;GAGG;AACH,MAAM,UAAU,SAAS,CACvB,EAAU,EACV,IAAiC;IAEjC,IAAI,IAAI,KAAK,OAAO,IAAI,SAAS,CAAC,EAAE,CAAC,KAAK,IAAI;QAC5C,OAAO,GAAG,EAAE,4EAA4E,CAAC;IAC3F,IAAI,IAAI,KAAK,QAAQ,IAAI,UAAU,CAAC,EAAE,CAAC;QACrC,OAAO,GAAG,EAAE,6EAA6E,CAAC;IAC5F,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,EAAU,EACV,IAAY,EACZ,SAAoE,EACjD,EAAE,CACrB,SAAS;KACN,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;IACZ,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;AACtC,CAAC,CAAC;KACD,GAAG,CACF,CAAC,CAAC,EAAE,EAAE,CACJ,GAAG,EAAE,SAAS,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,EAAE,eAAe,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,6BAA6B,MAAM,CAAC,IAAI,CAAC,WAAW,CAC/I,CAAC"}
|
package/dist/domain/licence.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
/** What a corpus stores of a copy: its extracted text (every variant), or the PDF. */
|
|
15
15
|
export declare const STORED_KINDS: readonly ["text", "pdf"];
|
|
16
16
|
export type StoredKind = (typeof STORED_KINDS)[number];
|
|
17
|
-
/** SPDX's
|
|
17
|
+
/** SPDX's keyword (not a list id) for "no licence information was given": here, the licence was not read. */
|
|
18
18
|
export declare const NOASSERTION = "NOASSERTION";
|
|
19
19
|
/** The project's one setting the table reads: it declares itself non-commercial. */
|
|
20
20
|
export interface LicenceSettings {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"licence.d.ts","sourceRoot":"","sources":["../../src/domain/licence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,sFAAsF;AACtF,eAAO,MAAM,YAAY,0BAA2B,CAAC;AACrD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,
|
|
1
|
+
{"version":3,"file":"licence.d.ts","sourceRoot":"","sources":["../../src/domain/licence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,sFAAsF;AACtF,eAAO,MAAM,YAAY,0BAA2B,CAAC;AACrD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,6GAA6G;AAC7G,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,oFAAoF;AACpF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAED,+FAA+F;AAC/F,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE;AACtD,0FAA0F;GACxF;IAAE,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAA;CAAE;AAC1C,uDAAuD;GACrD;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE;AAC/B,qCAAqC;GACnC;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAmCvD;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,IAAI,MAAM,KAAG,OACiC,CAAC;AAE3E,6FAA6F;AAC7F,wBAAgB,OAAO,CACrB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,GAClC,UAAU,CAWZ"}
|
package/dist/domain/licence.js
CHANGED
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
*/
|
|
14
14
|
/** What a corpus stores of a copy: its extracted text (every variant), or the PDF. */
|
|
15
15
|
export const STORED_KINDS = ["text", "pdf"];
|
|
16
|
-
/** SPDX's
|
|
16
|
+
/** SPDX's keyword (not a list id) for "no licence information was given": here, the licence was not read. */
|
|
17
17
|
export const NOASSERTION = "NOASSERTION";
|
|
18
18
|
const ND = {
|
|
19
19
|
no: "ND permits reproduction in unmodified form; whether an extracted text is an adaptation is unsettled",
|
|
20
20
|
};
|
|
21
21
|
const ARXIV = {
|
|
22
|
-
no: '
|
|
22
|
+
no: 'its only grant is to arXiv: "I grant arXiv.org a perpetual, non-exclusive license to distribute this article" (arxiv.org/licenses/nonexclusive-distrib/1.0/license.html), and nothing to anyone else',
|
|
23
23
|
};
|
|
24
24
|
const PUBLISHER = {
|
|
25
25
|
no: "the publisher grants no right to third parties",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"licence.js","sourceRoot":"","sources":["../../src/domain/licence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,sFAAsF;AACtF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,KAAK,CAAU,CAAC;AAGrD,
|
|
1
|
+
{"version":3,"file":"licence.js","sourceRoot":"","sources":["../../src/domain/licence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,sFAAsF;AACtF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,KAAK,CAAU,CAAC;AAGrD,6GAA6G;AAC7G,MAAM,CAAC,MAAM,WAAW,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AO,CACrB,EAAU,EACV,IAAgB,EAChB,QAAmC;IAEnC,IAAI,EAAE,KAAK,WAAW;QAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IACpD,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC1B,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;IACvD,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;IACxB,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAClD,IAAI,KAAK,KAAK,gBAAgB;QAC5B,OAAO,QAAQ,CAAC,aAAa;YAC3B,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE;YACvB,CAAC,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;IACtC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createRequire as __plCreateRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __plFileURLToPath } from "node:url";
|
|
3
|
+
import { dirname as __plDirname } from "node:path";
|
|
4
|
+
const require = __plCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = __plFileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __plDirname(__filename);
|
|
7
|
+
|
|
8
|
+
// src/domain/edition.ts
|
|
9
|
+
var SERIES = "[a-z0-9]+(?:-[a-z0-9]+)*";
|
|
10
|
+
var EDITION_ID = new RegExp(`^(${SERIES})-(\\d{4})$`, "u");
|
|
11
|
+
var SERIES_ID = new RegExp(`^${SERIES}$`, "u");
|
|
12
|
+
var endsInYear = (id) => /\d{4}$/u.test(id);
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
SERIES_ID,
|
|
16
|
+
endsInYear
|
|
17
|
+
};
|
|
@@ -118,14 +118,14 @@ pull requests that follow. It is the base for #302, #568, #356, #500, #215, #608
|
|
|
118
118
|
gets a finding of its own that names it (so a `CC-BY-3.0` does not hide the rest of the record, and
|
|
119
119
|
a typo is still loud).
|
|
120
120
|
|
|
121
|
-
| id | may store text | may store the PDF | why
|
|
122
|
-
| -------------------------------------- | ---------------------------------- | ---------------------------------- |
|
|
123
|
-
| `CC0-1.0`, `CC-BY-4.0`, `CC-BY-SA-4.0` | yes | yes | "anyone who has access to a copy of the material may continue to redistribute it" (CC FAQ)
|
|
124
|
-
| `CC-BY-NC-4.0`, `CC-BY-NC-SA-4.0` | when the project is non-commercial | when the project is non-commercial | non-commercial reproduction is granted; whether a repository is non-commercial is the project's to declare, not paperlint's to assume
|
|
125
|
-
| `CC-BY-ND-4.0`, `CC-BY-NC-ND-4.0` | no | yes (NC: as above) | "the ND licenses do allow you to reproduce the material in unmodified form"; whether an extracted text is an adaptation is unsettled, so no
|
|
126
|
-
| `LicenseRef-arxiv-nonexclusive-1.0` | no | no |
|
|
127
|
-
| `LicenseRef-publisher` | no | no | no grant to third parties
|
|
128
|
-
| `NOASSERTION` | no | no | the licence was not read
|
|
121
|
+
| id | may store text | may store the PDF | why |
|
|
122
|
+
| -------------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
123
|
+
| `CC0-1.0`, `CC-BY-4.0`, `CC-BY-SA-4.0` | yes | yes | "anyone who has access to a copy of the material may continue to redistribute it" (CC FAQ) |
|
|
124
|
+
| `CC-BY-NC-4.0`, `CC-BY-NC-SA-4.0` | when the project is non-commercial | when the project is non-commercial | non-commercial reproduction is granted; whether a repository is non-commercial is the project's to declare, not paperlint's to assume |
|
|
125
|
+
| `CC-BY-ND-4.0`, `CC-BY-NC-ND-4.0` | no | yes (NC: as above) | "the ND licenses do allow you to reproduce the material in unmodified form"; whether an extracted text is an adaptation is unsettled, so no |
|
|
126
|
+
| `LicenseRef-arxiv-nonexclusive-1.0` | no | no | its only grant is to arXiv: "I grant arXiv.org a perpetual, non-exclusive license to distribute this article" (arxiv.org/licenses/nonexclusive-distrib/1.0/license.html), and nothing to anyone else |
|
|
127
|
+
| `LicenseRef-publisher` | no | no | no grant to third parties |
|
|
128
|
+
| `NOASSERTION` | no | no | the licence was not read |
|
|
129
129
|
|
|
130
130
|
The project declares itself non-commercial with one setting; without it an NC copy that is stored is a
|
|
131
131
|
finding that names the setting. SPDX ids where SPDX has one; `LicenseRef-…` where it has none, as SPDX
|
|
@@ -209,14 +209,14 @@ to its paper folder. Licences that were never read stay `NOASSERTION` until PR 2
|
|
|
209
209
|
|
|
210
210
|
## The order of the pull requests
|
|
211
211
|
|
|
212
|
-
| PR | what
|
|
213
|
-
| ------ |
|
|
214
|
-
| 1a | the schema and its parser, the licence table, this note, `docs/venues.md` and `study-accepted-papers` rewritten to the record (decision 7)
|
|
215
|
-
| 1b-i | `corpus/record` on `papers.json`, linted with `@eslint/json` and reporting at the field; the record gains `capped`, `proxy` and `rebuild`; `MANIFEST.md` optional; the corpus kept out of the paper rules; the rule's page under `docs/rules/corpus/`, linked from `docs/venues.md`
|
|
216
|
-
| 1b-ii | `corpus/allowed-files-only` (#500's second rule, moved up from PR 4): the corpus's fixed names, and a corpus with `pdf/` or `text/` and no `papers.json`, reported on the root `paperlint.json`; merged right after 1b-i, so a consumer meets both in one evening
|
|
217
|
-
| 1b-iii | `corpus/licence` (off, in no set) with its page, linked from `docs/optional-rules.md`; a test that every rule id has the one-slash shape of "A Rule Id Names Its Subject"
|
|
218
|
-
| 2 | the venue lister #568 asks for, as a shared tested script that `study-accepted-papers` calls (not a new CLI command), writing `papers.json` rows with ids and licences
|
|
219
|
-
| 3 | the current cycle's venue has a corpus (matched by series, decision 1), the first of #356's three parts
|
|
212
|
+
| PR | what | part of |
|
|
213
|
+
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------- |
|
|
214
|
+
| 1a | the schema and its parser, the licence table, this note, `docs/venues.md` and `study-accepted-papers` rewritten to the record (decision 7) | #302 |
|
|
215
|
+
| 1b-i | `corpus/record` on `papers.json`, linted with `@eslint/json` and reporting at the field; the record gains `capped`, `proxy` and `rebuild`; `MANIFEST.md` optional; the corpus kept out of the paper rules; the rule's page under `docs/rules/corpus/`, linked from `docs/venues.md` | #302, #215 (1) |
|
|
216
|
+
| 1b-ii | `corpus/allowed-files-only` (#500's second rule, moved up from PR 4): the corpus's fixed names, and a corpus with `pdf/` or `text/` and no `papers.json`, reported on the root `paperlint.json`; merged right after 1b-i, so a consumer meets both in one evening | #500 (1 of 2) |
|
|
217
|
+
| 1b-iii | `corpus/licence` (off, in no set: a one-member set is its id; a `paperlint:corpus` set waits for a second opt-in corpus rule, #675) with its page, linked from `docs/optional-rules.md`; a record's `venue` is its folder's name and a series id; a test that every rule id has the one-slash shape of "A Rule Id Names Its Subject" | #302 |
|
|
218
|
+
| 2 | the venue lister #568 asks for, as a shared tested script that `study-accepted-papers` calls (not a new CLI command), writing `papers.json` rows with ids and licences | #568 |
|
|
219
|
+
| 3 | the current cycle's venue has a corpus (matched by series, decision 1), the first of #356's three parts; a named venue, or a venue file of the author's own whose id has no year, has no series, so this PR defines the key that names its corpus | #356 (1 of 3) |
|
|
220
220
|
|
|
221
221
|
PR 1a stands alone: a corpus written by hand, or by the skill, validates. Readers that compare a paper with
|
|
222
222
|
the corpus (#608 abstract rewrites, #465 the panel's demands, a title and scope comparison) come after PR 2.
|
package/docs/optional-rules.md
CHANGED
|
@@ -55,16 +55,17 @@ writing, not a number the venue states.
|
|
|
55
55
|
|
|
56
56
|
## The other optional rules
|
|
57
57
|
|
|
58
|
-
| rule | what it checks | who needs it
|
|
59
|
-
| ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
60
|
-
| `pdf/last-page-balance` | the two columns of the last page end at about the same height | two-column papers whose publisher asks for it — see below
|
|
61
|
-
| [`tex/heading-case`](rules/tex/heading-case.md) | the words of the paper's title and of each heading are in the capitalization the venue asks | papers whose venue names a case style paperlint builds; only the AgenticDev preset turns it on (`chicago-headline` for the title and every heading) — [page](rules/tex/heading-case.md)
|
|
62
|
-
| [`tex/term-before-definition`](rules/tex/term-before-definition.md) | a term the body defines with `\emph` is not used before that definition | papers that mark each definition in italics; others mostly use italics for stress — [page](rules/tex/term-before-definition.md)
|
|
63
|
-
| [`tex/term-defined-twice`](rules/tex/term-defined-twice.md) | a term the body defines is set as a definition once | the same papers — [page](rules/tex/term-defined-twice.md)
|
|
64
|
-
| [`study/declare-sample`](rules/study/declare-sample.md) | experimental: a study's `prereg.json` declares its population, screens, coverage and the author's check of the drawn units | papers with a sampled study; no preset turns it on — [page](rules/study/declare-sample.md)
|
|
65
|
-
| [`cycle/changes-since-approved`](rules/cycle/changes-since-approved.md) | experimental: what the approved text had (numbers, cite keys) and the draft lacks is declared in `changes.yaml` | papers that keep an approved version; no preset turns it on — [page](rules/cycle/changes-since-approved.md)
|
|
66
|
-
| [`cycle/changes-since-approved-coverage`](rules/cycle/changes-since-approved-coverage.md) | experimental: each paragraph of the approved text that is gone is covered by a `changes.yaml` entry | the same; a warning — [page](rules/cycle/changes-since-approved-coverage.md)
|
|
67
|
-
| [`artifact/upload-current`](rules/artifact/upload-current.md) | the paper prints the numbers its uploaded artifact was built for, as the upload record (`paperlint artifact record`) says | papers with an uploaded artifact and a file of number macros; turned on with `["warn", { "numbers": "numbersdef.tex" }]` — [page](rules/artifact/upload-current.md)
|
|
58
|
+
| rule | what it checks | who needs it |
|
|
59
|
+
| ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
60
|
+
| `pdf/last-page-balance` | the two columns of the last page end at about the same height | two-column papers whose publisher asks for it — see below |
|
|
61
|
+
| [`tex/heading-case`](rules/tex/heading-case.md) | the words of the paper's title and of each heading are in the capitalization the venue asks | papers whose venue names a case style paperlint builds; only the AgenticDev preset turns it on (`chicago-headline` for the title and every heading) — [page](rules/tex/heading-case.md) |
|
|
62
|
+
| [`tex/term-before-definition`](rules/tex/term-before-definition.md) | a term the body defines with `\emph` is not used before that definition | papers that mark each definition in italics; others mostly use italics for stress — [page](rules/tex/term-before-definition.md) |
|
|
63
|
+
| [`tex/term-defined-twice`](rules/tex/term-defined-twice.md) | a term the body defines is set as a definition once | the same papers — [page](rules/tex/term-defined-twice.md) |
|
|
64
|
+
| [`study/declare-sample`](rules/study/declare-sample.md) | experimental: a study's `prereg.json` declares its population, screens, coverage and the author's check of the drawn units | papers with a sampled study; no preset turns it on — [page](rules/study/declare-sample.md) |
|
|
65
|
+
| [`cycle/changes-since-approved`](rules/cycle/changes-since-approved.md) | experimental: what the approved text had (numbers, cite keys) and the draft lacks is declared in `changes.yaml` | papers that keep an approved version; no preset turns it on — [page](rules/cycle/changes-since-approved.md) |
|
|
66
|
+
| [`cycle/changes-since-approved-coverage`](rules/cycle/changes-since-approved-coverage.md) | experimental: each paragraph of the approved text that is gone is covered by a `changes.yaml` entry | the same; a warning — [page](rules/cycle/changes-since-approved-coverage.md) |
|
|
67
|
+
| [`artifact/upload-current`](rules/artifact/upload-current.md) | the paper prints the numbers its uploaded artifact was built for, as the upload record (`paperlint artifact record`) says | papers with an uploaded artifact and a file of number macros; turned on with `["warn", { "numbers": "numbersdef.tex" }]` — [page](rules/artifact/upload-current.md) |
|
|
68
|
+
| [`corpus/licence`](rules/corpus/licence.md) | each copy a venue corpus stores has a licence that permits keeping that file | a project whose corpus others can read (the same files are legal in a private repository); `"warn"`, and `["warn", { "nonCommercial": true }]` for a non-commercial project — [page](rules/corpus/licence.md) |
|
|
68
69
|
|
|
69
70
|
## `pdf/last-page-balance`
|
|
70
71
|
|