@scientific-method/standard-checker 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Igor Savin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @scientific-method/standard-checker
2
+
3
+ Checks a game restoration's `spec/`, `parity/` and `deviations/` against version 1 of the
4
+ [dinorefurb documentation standard](https://dinorefurb.com/documentation-standard/#checks), and
5
+ writes what the standard says is generated: the four indexes in `spec/index/`, the totals in
6
+ `PARITY.md`, and on request `VALIDATION.md`. It has no dependencies and needs Node 22 or later.
7
+
8
+ ```sh
9
+ pnpm add -D @scientific-method/standard-checker
10
+ pnpm exec standard-checker # check, then rewrite stale indexes and PARITY.md
11
+ pnpm exec standard-checker --check # check, and fail on a stale index or PARITY.md
12
+ ```
13
+
14
+ It exits with 0 when the repository passes, 1 when it reports problems (one line per problem,
15
+ starting with the file's path), and 2 when the options are invalid. `--record-validation` cannot be
16
+ combined with `--check`.
17
+
18
+ ## Options
19
+
20
+ | Option | Meaning | Default |
21
+ |---|---|---|
22
+ | `--root <dir>` | The repository to check. | the current directory |
23
+ | `--check` | Fail when an index or `PARITY.md` is stale, instead of rewriting it. | rewrite |
24
+ | `--base <ref>` | Also fail when a spec ID, area or deviation that exists at `<ref>` is gone. | where HEAD forked from `origin/$GITHUB_BASE_REF` or `origin/main`, when that resolves |
25
+ | `--no-ksy` | Skip compiling the Kaitai definitions in `spec/formats/`. | compile |
26
+ | `--glossary <path>` | Also accept the terms of a draft glossary file, or of a directory of them. | none |
27
+ | `--code <dirs>` | Comma-separated directories whose files may cite spec and deviation IDs and hold `PLACEHOLDER` comments. | `src,tests,tools` |
28
+ | `--references <dirs>` | Comma-separated directories whose files may cite IDs but whose `PLACEHOLDER` comments do not count against parity. | none |
29
+ | `--images <ranges>` | Comma-separated half-open address ranges of the original's flat 32-bit images, such as `0x00400000..0x004C9000`. A `0x` value inside one that a code comment gives must be recorded in an entry the comment cites. | none, so only `fn_` and `g_` names are checked |
30
+ | `--max-range <bytes>` | The largest address range an entry can record an address by. A larger one, such as a whole section, records only its two ends. | `0x10000` |
31
+ | `--data-dirs <dirs>` | Comma-separated top-level directories of the original's data. A path into one must name a file of some build, with its exact case. | the top-level directories of the files the build entries list |
32
+ | `--record-validation <builds>` | Write `VALIDATION.md` for the marked test files of validated parity rows, naming the comma-separated build IDs the run used. Run it only after every test in those files passed with none skipped. | not written |
33
+ | `--help` | Print the options. | |
34
+
35
+ The `KSC` environment variable names the Kaitai Struct compiler. Without it, the checker looks for
36
+ `kaitai-struct-compiler` or `ksc` on `PATH`, and warns when it finds neither.
37
+
38
+ ## In GitHub Actions
39
+
40
+ The toolkit's `actions/check-documentation` composite action runs this checker with `--check`,
41
+ installs a pinned Kaitai compiler when the repository has `.ksy` files, and exposes every option
42
+ above as an input. Pin the action to the toolkit commit whose `packages/standard-checker` matches
43
+ the version installed here, so CI and local runs apply the same checks.
44
+
45
+ [The documentation standard check guide](https://github.com/kibertoad/refurbished-dinosaurs-toolkit/blob/main/docs/documentation-standard-check.md)
46
+ covers setting up the action, every check the tool makes, and moving an older restoration onto it.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};