@r_masseater/fu4 0.1.0 → 0.2.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/README.md CHANGED
@@ -1,49 +1,99 @@
1
1
  # @r_masseater/fu4
2
2
 
3
- ![fu4 logo](logo.svg)
3
+ <img src="logo.svg" alt="fu4 logo" width="256">
4
4
 
5
- A GitHub Actions workflow linter written in Rust and configured from `vite.config.ts`.
5
+ The engine of a GitHub Actions linter, configured from `vite.config.ts`.
6
6
 
7
- It reports what [actionlint](https://github.com/rhysd/actionlint) reports, with the same
8
- messages and positions, except for its pyflakes integration. Instead of running shellcheck,
9
- it checks `run:` scripts itself with tree-sitter-bash for the most common shellcheck findings.
10
- It also accepts the `$/` self repository reference in `uses:`, which actionlint 1.7.12 rejects.
11
- Its knowledge of
12
- contexts, events, permissions, runners and popular actions is generated from GitHub's docs and
13
- schemas.
7
+ fu4 parses workflows, `action.yml` files, the Dependabot config and pre-commit configs in Rust,
8
+ hands the YAML and tree-sitter trees to TypeScript rules without copying them, and runs those
9
+ rules. It ships no rules of its own. Take the official ones from
10
+ [`@r_masseater/fu4-presets`](https://www.npmjs.com/package/@r_masseater/fu4-presets): actionlint's
11
+ checks and zizmor's audits.
14
12
 
15
- It also runs [zizmor](https://github.com/zizmorcore/zizmor)'s security audits on workflows,
16
- actions, Dependabot configs and pre-commit configs, with zizmor's findings and positions, built
17
- on zizmor's published crates. Audits that query GitHub run when `GH_TOKEN` is set. zizmor's
18
- auto-fixes are not included.
13
+ ```sh
14
+ npm install -D @r_masseater/fu4 @r_masseater/fu4-presets effect
15
+ ```
19
16
 
20
17
  ```ts
21
18
  import "@r_masseater/fu4/vite";
19
+ import { recommended } from "@r_masseater/fu4-presets";
22
20
  import { defineConfig } from "vite-plus";
23
21
 
24
22
  export default defineConfig({
25
23
  fu4: {
26
- selfHostedRunner: { labels: ["gpu"] },
27
- configVariables: ["DEPLOY_TARGET"],
28
- paths: {
29
- ".github/workflows/release.yml": { ignore: ['^input "token" is not defined'] },
30
- },
31
- ignores: [".github/workflows/vendored-*.yml"],
32
- audit: {
33
- persona: "regular",
34
- minSeverity: "low",
35
- rules: { "unpinned-uses": { config: { policies: { "actions/*": "ref-pin" } } } },
36
- },
24
+ extends: [recommended()],
25
+ rules: { "zizmor/stale-action-refs": "warn" },
26
+ overrides: [
27
+ { files: [".github/workflows/vendored-*.yml"], rules: { "actionlint/shellcheck": "off" } },
28
+ ],
29
+ ignores: [".github/workflows/generated-*.yml"],
37
30
  },
38
31
  });
39
32
  ```
40
33
 
41
- `audit.rules` takes the `rules` section of a zizmor config. Set `audit.online` to `false` to
42
- skip the audits that query GitHub.
34
+ | Key | Meaning |
35
+ | ----------- | --------------------------------------------------------------------- |
36
+ | `extends` | Configs to start from; this config's own keys come after them and win |
37
+ | `plugins` | Rule plugins by name; a rule is then `<plugin>/<rule>` |
38
+ | `rules` | `"error"`, `"warn"` or `"off"` per rule, or `[severity, options]` |
39
+ | `settings` | Settings every rule can read, keyed by plugin |
40
+ | `overrides` | `files` globs with their own `rules` |
41
+ | `ignores` | Globs of files the CLI does not lint |
42
+
43
+ Run `fu4` in the repository root. It lints the workflows under `.github/workflows`, the
44
+ `action.yml` files, `.github/dependabot.yml` and the pre-commit configs at the root, prints
45
+ `path:line:column: message [rule]`, and exits with 1 when it reports anything. Pass pathspecs to
46
+ lint other files. From code, `lint({ root, files, config })` returns the diagnostics as an Effect.
47
+
48
+ Write your own rules with `defineRule` and group them with `definePlugin`. A rule receives the
49
+ parsed source, can parse a `run:` script with `parseScript`, and reports positions with
50
+ `report`.
51
+
52
+ ## Comparison
53
+
54
+ Measured on 2026-11-19 on linux x64, 4 CPUs with [lint-bench](https://github.com/masseater/masseater.dev/tree/main/tools/lint-bench), which keeps the full results in [results.md](https://github.com/masseater/masseater.dev/blob/main/tools/lint-bench/results/results.md). Cold runs drop the page cache and the tools' caches first. "Same as ours", "Only ours" and "Only theirs" compare findings by file, line and rule where both tools use the same rules.
55
+
56
+ On the same files in nodejs/node, fu4 reports 74 of the 86 findings of actionlint and zizmor together and none of its own. The other 12 are actionlint 1.7.12 errors on `$/` paths in `uses:`, GitHub's syntax for an action or reusable workflow in the same repository, which actionlint does not accept yet. fu4 is slower, mostly in starting Node and loading the presets.
57
+
58
+ ### masseater.dev
59
+
60
+ | Tool | Version | Cold | Warm | Peak RSS | Findings | Same as ours | Only ours | Only theirs |
61
+ | ------------------- | ------------------------------------ | ------- | ---------------- | -------- | -------- | ------------ | --------- | ----------- |
62
+ | ghalint | 1.6.0 | 84 ms | 32 ms ± 4 ms | 16 MB | 35 | | | |
63
+ | actionlint | 1.7.12 | 110 ms | 71 ms ± 3 ms | 23 MB | 0 | | | |
64
+ | zizmor | 1.32.0 | 140 ms | 105 ms ± 16 ms | 31 MB | 0 | | | |
65
+ | actionlint + zizmor | 1.7.12 + 1.32.0 | 238 ms | 170 ms ± 9 ms | 31 MB | 0 | 0 | 0 | 0 |
66
+ | poutine | 1.1.6 | 672 ms | 429 ms ± 14 ms | 55 MB | 39 | | | |
67
+ | **fu4** | workspace, fu4-presets recommended() | 1.75 s | 1.50 s ± 41 ms | 463 MB | 0 | | | |
68
+ | sisakulint | 0.3.8 | 10.11 s | 10.14 s ± 370 ms | 51 MB | 46 | | | |
69
+
70
+ - fu4: Workflows, action.yml files and the Dependabot config, offline, recommended or default rules
71
+ - actionlint + zizmor: Workflows, action.yml files and the Dependabot config, offline, recommended or default rules
72
+ - actionlint: Workflows only, with shellcheck
73
+ - zizmor: Workflows, action.yml files and the Dependabot config, offline, regular persona
74
+ - poutine: Workflows and actions, default rules
75
+ - ghalint: Workflows and actions, default policies
76
+ - sisakulint: Workflows, default rules
77
+
78
+ ### nodejs/node
79
+
80
+ | Tool | Version | Cold | Warm | Peak RSS | Findings | Same as ours | Only ours | Only theirs |
81
+ | ------------------- | ------------------------------------ | ------ | --------------- | -------- | -------- | ------------ | --------- | ----------- |
82
+ | ghalint | 1.6.0 | 202 ms | 97 ms ± 5 ms | 18 MB | 92 | | | |
83
+ | zizmor | 1.32.0 | 240 ms | 188 ms ± 15 ms | 35 MB | 18 | | | |
84
+ | actionlint | 1.7.12 | 374 ms | 347 ms ± 11 ms | 28 MB | 68 | | | |
85
+ | actionlint + zizmor | 1.7.12 + 1.32.0 | 609 ms | 544 ms ± 6 ms | 36 MB | 86 | 74 | 0 | 12 |
86
+ | poutine | 1.1.6 | 1.22 s | 778 ms ± 17 ms | 55 MB | 43 | | | |
87
+ | **fu4** | workspace, fu4-presets recommended() | 3.12 s | 2.66 s ± 101 ms | 546 MB | 74 | | | |
88
+ | sisakulint | 0.3.8 | 8.16 s | 8.25 s ± 732 ms | 30 MB | 31 | | | |
43
89
 
44
- Run `fu4` to lint the workflows under `.github/workflows`, the `action.yml` files, the
45
- Dependabot config and the pre-commit configs, or pass pathspecs to lint others.
46
- Call `lint` to lint from code.
90
+ - fu4: Workflows, action.yml files and the Dependabot config, offline, recommended or default rules
91
+ - actionlint + zizmor: Workflows, action.yml files and the Dependabot config, offline, recommended or default rules
92
+ - actionlint: Workflows only, with shellcheck
93
+ - zizmor: Workflows, action.yml files and the Dependabot config, offline, regular persona
94
+ - poutine: Workflows and actions, default rules
95
+ - ghalint: Workflows and actions, default policies
96
+ - sisakulint: Workflows, default rules
47
97
 
48
98
  ## Agent skills
49
99