@r_masseater/fu4 0.1.0 → 0.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/README.md +113 -30
- package/dist/app-KgCbMsJa.mjs +632 -0
- package/dist/app-KgCbMsJa.mjs.map +1 -0
- package/dist/cli-CfFhh0Tu.mjs +15 -0
- package/dist/cli-CfFhh0Tu.mjs.map +1 -0
- package/dist/cli.mjs +3 -12
- package/dist/cli.mjs.map +1 -1
- package/dist/index-DFaQsB5x.d.mts +114 -0
- package/dist/index.d.mts +20 -7
- package/dist/index.mjs +3 -1
- package/dist/presets.d.mts +662 -0
- package/dist/presets.mjs +42796 -0
- package/dist/presets.mjs.map +1 -0
- package/dist/types-CsheTVso.mjs +2131 -0
- package/dist/types-CsheTVso.mjs.map +1 -0
- package/dist/vite.d.mts +1 -1
- package/package.json +30 -21
- package/skills/apply-fu4-presets/SKILL.md +62 -0
- package/skills/lint-workflows/SKILL.md +31 -43
- package/dist/app-D0TgXIa0.mjs +0 -211
- package/dist/app-D0TgXIa0.mjs.map +0 -1
- package/dist/types-DywsX0Gn.d.mts +0 -34
package/README.md
CHANGED
|
@@ -1,50 +1,133 @@
|
|
|
1
1
|
# @r_masseater/fu4
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<img src="logo.svg" alt="fu4 logo" width="256">
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The engine of a GitHub Actions linter, configured from `vite.config.ts`.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
+
the `@r_masseater/fu4/presets` subpath: actionlint's
|
|
11
|
+
checks and zizmor's audits.
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
auto-fixes are not included.
|
|
13
|
+
```sh
|
|
14
|
+
npm install -D @r_masseater/fu4 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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
".github/workflows/
|
|
30
|
-
|
|
31
|
-
ignores: [".github/workflows/
|
|
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
|
-
|
|
42
|
-
|
|
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
|
+
## Presets
|
|
53
|
+
|
|
54
|
+
List the presets you want in `extends`, or take both with `recommended()`. Every rule of a chosen
|
|
55
|
+
preset is an error. Override one in `rules`, such as `"zizmor/stale-action-refs": "warn"`.
|
|
56
|
+
|
|
57
|
+
| Preset | Rules |
|
|
58
|
+
| ------------ | ---------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| `actionlint` | `actionlint/*`: what [actionlint](https://github.com/rhysd/actionlint) reports, with its shellcheck checks |
|
|
60
|
+
| `zizmor` | `zizmor/*`: the audits of [zizmor](https://github.com/zizmorcore/zizmor), with its findings and positions |
|
|
61
|
+
|
|
62
|
+
`actionlint()` takes the options of actionlint's `actionlint.yaml`.
|
|
63
|
+
|
|
64
|
+
`zizmor()` takes these options.
|
|
65
|
+
|
|
66
|
+
| Option | Meaning |
|
|
67
|
+
| --------------- | ------------------------------------------------------------------------------------------------- |
|
|
68
|
+
| `concerns` | `injection`, `supply-chain`, `references`, `credentials`, `workflow` and `config`; all by default |
|
|
69
|
+
| `persona` | `regular`, `pedantic` or `auditor`, as zizmor's `--persona` |
|
|
70
|
+
| `minSeverity` | The lowest severity to report |
|
|
71
|
+
| `minConfidence` | The lowest confidence to report |
|
|
72
|
+
| `rules` | The `rules` section of a zizmor config |
|
|
73
|
+
| `online` | `false` skips the audits that query GitHub |
|
|
74
|
+
| `githubHost` | The GitHub host to query, such as a GitHub Enterprise Server host; `github.com` by default |
|
|
75
|
+
|
|
76
|
+
The audits that query GitHub read a token from `ZIZMOR_GITHUB_TOKEN`, `GH_TOKEN` or
|
|
77
|
+
`GITHUB_TOKEN`, in that order, and are skipped without one. They list a repository's branches and
|
|
78
|
+
tags through git's protocol, and list a public repository anonymously when GitHub rejects the token there.
|
|
79
|
+
Commits found to be reachable are remembered in
|
|
80
|
+
`node_modules/.cache/fu4/zizmor-reachable-commits.txt`, so later runs do not ask GitHub again.
|
|
81
|
+
zizmor's auto-fixes are not included.
|
|
82
|
+
|
|
83
|
+
The preset rules use only the rule API of fu4, so they need no native build of their own.
|
|
84
|
+
|
|
85
|
+
## Comparison
|
|
86
|
+
|
|
87
|
+
Measured on 2026-11-19 on linux x64, 4 CPUs with [lint-bench](https://github.com/masseater/ecosystems/tree/main/tools/lint-bench), which keeps the full results in [results.md](https://github.com/masseater/ecosystems/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.
|
|
88
|
+
|
|
89
|
+
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.
|
|
90
|
+
|
|
91
|
+
### masseater.dev
|
|
92
|
+
|
|
93
|
+
| Tool | Version | Cold | Warm | Peak RSS | Findings | Same as ours | Only ours | Only theirs |
|
|
94
|
+
| ------------------- | ------------------------------------ | ------- | ---------------- | -------- | -------- | ------------ | --------- | ----------- |
|
|
95
|
+
| ghalint | 1.6.0 | 84 ms | 32 ms ± 4 ms | 16 MB | 35 | | | |
|
|
96
|
+
| actionlint | 1.7.12 | 110 ms | 71 ms ± 3 ms | 23 MB | 0 | | | |
|
|
97
|
+
| zizmor | 1.32.0 | 140 ms | 105 ms ± 16 ms | 31 MB | 0 | | | |
|
|
98
|
+
| actionlint + zizmor | 1.7.12 + 1.32.0 | 238 ms | 170 ms ± 9 ms | 31 MB | 0 | 0 | 0 | 0 |
|
|
99
|
+
| poutine | 1.1.6 | 672 ms | 429 ms ± 14 ms | 55 MB | 39 | | | |
|
|
100
|
+
| **fu4** | workspace, fu4-presets recommended() | 1.75 s | 1.50 s ± 41 ms | 463 MB | 0 | | | |
|
|
101
|
+
| sisakulint | 0.3.8 | 10.11 s | 10.14 s ± 370 ms | 51 MB | 46 | | | |
|
|
102
|
+
|
|
103
|
+
- fu4: Workflows, action.yml files and the Dependabot config, offline, recommended or default rules
|
|
104
|
+
- actionlint + zizmor: Workflows, action.yml files and the Dependabot config, offline, recommended or default rules
|
|
105
|
+
- actionlint: Workflows only, with shellcheck
|
|
106
|
+
- zizmor: Workflows, action.yml files and the Dependabot config, offline, regular persona
|
|
107
|
+
- poutine: Workflows and actions, default rules
|
|
108
|
+
- ghalint: Workflows and actions, default policies
|
|
109
|
+
- sisakulint: Workflows, default rules
|
|
110
|
+
|
|
111
|
+
### nodejs/node
|
|
112
|
+
|
|
113
|
+
| Tool | Version | Cold | Warm | Peak RSS | Findings | Same as ours | Only ours | Only theirs |
|
|
114
|
+
| ------------------- | ------------------------------------ | ------ | --------------- | -------- | -------- | ------------ | --------- | ----------- |
|
|
115
|
+
| ghalint | 1.6.0 | 202 ms | 97 ms ± 5 ms | 18 MB | 92 | | | |
|
|
116
|
+
| zizmor | 1.32.0 | 240 ms | 188 ms ± 15 ms | 35 MB | 18 | | | |
|
|
117
|
+
| actionlint | 1.7.12 | 374 ms | 347 ms ± 11 ms | 28 MB | 68 | | | |
|
|
118
|
+
| actionlint + zizmor | 1.7.12 + 1.32.0 | 609 ms | 544 ms ± 6 ms | 36 MB | 86 | 74 | 0 | 12 |
|
|
119
|
+
| poutine | 1.1.6 | 1.22 s | 778 ms ± 17 ms | 55 MB | 43 | | | |
|
|
120
|
+
| **fu4** | workspace, fu4-presets recommended() | 3.12 s | 2.66 s ± 101 ms | 546 MB | 74 | | | |
|
|
121
|
+
| sisakulint | 0.3.8 | 8.16 s | 8.25 s ± 732 ms | 30 MB | 31 | | | |
|
|
43
122
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
123
|
+
- fu4: Workflows, action.yml files and the Dependabot config, offline, recommended or default rules
|
|
124
|
+
- actionlint + zizmor: Workflows, action.yml files and the Dependabot config, offline, recommended or default rules
|
|
125
|
+
- actionlint: Workflows only, with shellcheck
|
|
126
|
+
- zizmor: Workflows, action.yml files and the Dependabot config, offline, regular persona
|
|
127
|
+
- poutine: Workflows and actions, default rules
|
|
128
|
+
- ghalint: Workflows and actions, default policies
|
|
129
|
+
- sisakulint: Workflows, default rules
|
|
47
130
|
|
|
48
131
|
## Agent skills
|
|
49
132
|
|
|
50
|
-
The package ships
|
|
133
|
+
The package ships agent skills in `skills/`. Add `permissions: { "@r_masseater/fu4": { skills: true } }` to `pnpm-workspace.yaml` and `vp install` links them into the skill directories of your agents.
|