@r_masseater/fu4 0.2.0 → 0.3.1

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
@@ -7,16 +7,16 @@ The engine of a GitHub Actions linter, configured from `vite.config.ts`.
7
7
  fu4 parses workflows, `action.yml` files, the Dependabot config and pre-commit configs in Rust,
8
8
  hands the YAML and tree-sitter trees to TypeScript rules without copying them, and runs those
9
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
10
+ the `@r_masseater/fu4/presets` subpath: actionlint's
11
11
  checks and zizmor's audits.
12
12
 
13
13
  ```sh
14
- npm install -D @r_masseater/fu4 @r_masseater/fu4-presets effect
14
+ npm install -D @r_masseater/fu4 effect
15
15
  ```
16
16
 
17
17
  ```ts
18
18
  import "@r_masseater/fu4/vite";
19
- import { recommended } from "@r_masseater/fu4-presets";
19
+ import { recommended } from "@r_masseater/fu4/presets";
20
20
  import { defineConfig } from "vite-plus";
21
21
 
22
22
  export default defineConfig({
@@ -49,9 +49,42 @@ Write your own rules with `defineRule` and group them with `definePlugin`. A rul
49
49
  parsed source, can parse a `run:` script with `parseScript`, and reports positions with
50
50
  `report`.
51
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
+
52
85
  ## Comparison
53
86
 
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.
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.
55
88
 
56
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.
57
90
 
@@ -97,4 +130,4 @@ On the same files in nodejs/node, fu4 reports 74 of the 86 findings of actionlin
97
130
 
98
131
  ## Agent skills
99
132
 
100
- The package ships TanStack Intent skills for coding agents. Load one with `vp exec intent load @r_masseater/fu4#<skill>`.
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.
@@ -0,0 +1,204 @@
1
+ import { S as settingOf, _ as traceparent, a as matcher, b as callAddon, c as baseName, d as pathspecsOf, f as sectionOf, g as mergedRecords, h as mergedLayers, m as layersOf, n as sourceOf, o as selects, p as notUtf8, r as sourceView, x as loadAddon, y as exposes } from "./source-BRZXj75b.mjs";
2
+ import { Array, Effect, Option, Order, Record, Schema, String as String$1, pipe } from "effect";
3
+ // src/app/format.ts
4
+ const format = (diagnostic) => `${diagnostic.path}:${String(diagnostic.line)}:${String(diagnostic.column)}: ${diagnostic.message} [${diagnostic.rule}]`;
5
+ // src/entities/rule/model/extend.ts
6
+ const flattenConfig = (config) => {
7
+ const layers = layersOf(config);
8
+ return {
9
+ ...mergedLayers(layers),
10
+ settings: mergedRecords(pipe(layers, Array.map((layer) => layer.settings)))
11
+ };
12
+ };
13
+ // src/entities/rule/model/resolve.ts
14
+ const SEPARATOR = "/";
15
+ const START = 0;
16
+ const enabled = ([id, entry]) => {
17
+ const { severity, options } = settingOf(entry);
18
+ if (severity === "off") return [];
19
+ return [{
20
+ id,
21
+ severity,
22
+ options
23
+ }];
24
+ };
25
+ const applies = (path) => (override) => selects(override.files)(path);
26
+ const isIgnored = (config) => (path) => matcher(config.ignores ?? [])(path);
27
+ const entriesFor = (config) => (path) => {
28
+ const merged = { ...config.rules };
29
+ for (const override of pipe(config.overrides ?? [], Array.filter(applies(path)))) Object.assign(merged, override.rules);
30
+ return merged;
31
+ };
32
+ const ruleOf = (config) => (id) => pipe(String$1.indexOf(SEPARATOR)(id), Option.flatMap((at) => pipe(Record.get(config.plugins ?? {}, String$1.slice(START, at)(id)), Option.flatMap((plugin) => Record.get(plugin.rules, String$1.slice(at + 1)(id))))));
33
+ const activate = (config) => (entry) => pipe(ruleOf(config)(entry.id), Option.map((rule) => ({
34
+ ...entry,
35
+ rule
36
+ })), Option.toArray);
37
+ const activeRules = (config) => (path) => pipe(Record.toEntries(entriesFor(config)(path)), Array.flatMap(enabled), Array.flatMap(activate(config)));
38
+ // src/entities/source/model/kind.ts
39
+ const WORKFLOWS = ".github/workflows/";
40
+ const YAML = /\.ya?ml$/u;
41
+ const ACTION = /^action\.ya?ml$/u;
42
+ const DEPENDABOT = /^\.github\/dependabot\.ya?ml$/u;
43
+ const PRE_COMMIT = /^\.pre-commit-(?:config|hooks)\.yaml$/u;
44
+ const kindOf = (path) => {
45
+ if (DEPENDABOT.test(path)) return Option.some("dependabot");
46
+ if (PRE_COMMIT.test(path)) return Option.some("pre-commit");
47
+ if (ACTION.test(baseName(path))) return Option.some("action");
48
+ if (String$1.includes(WORKFLOWS)(path) && YAML.test(path)) return Option.some("workflow");
49
+ return Option.none();
50
+ };
51
+ // src/shared/lib/errors.ts
52
+ const taggedError = Schema.TaggedError;
53
+ var Fu4Error = class extends taggedError()("Fu4Error", { message: Schema.String }) {};
54
+ const failedWith = (message) => (cause) => Fu4Error.make({ message: `${message}: ${String(cause)}` });
55
+ // src/shared/native/index.ts
56
+ const isNative = exposes([
57
+ "parsePaths",
58
+ "parseText",
59
+ "parseScript",
60
+ "readText",
61
+ "pathExists",
62
+ "flushTelemetry"
63
+ ]);
64
+ const native = loadAddon({
65
+ packageName: "@r_masseater/fu4",
66
+ binary: "fu4",
67
+ from: import.meta.url,
68
+ isAddon: isNative,
69
+ failWith: failedWith
70
+ });
71
+ // src/features/run-rules/model/order.ts
72
+ const byPosition = Order.combineAll([
73
+ Order.mapInput(Order.String, (found) => found.path),
74
+ Order.mapInput(Order.Number, (found) => found.line),
75
+ Order.mapInput(Order.Number, (found) => found.column),
76
+ Order.mapInput(Order.String, (found) => found.message)
77
+ ]);
78
+ const same = (left, right) => left.path === right.path && left.line === right.line && left.column === right.column && left.message === right.message && left.rule === right.rule;
79
+ const ordered = (found) => Array.dedupeWith(Array.sort(found, byPosition), same);
80
+ // src/features/run-rules/model/run.ts
81
+ const CONCURRENT$1 = { concurrency: "unbounded" };
82
+ const appliesTo = (kind) => ({ rule }) => pipe(rule.meta.kinds ?? ["workflow"], Array.some((each) => each === kind));
83
+ const diagnosticOf = (input, active) => ({ rule, ...report }) => ({
84
+ path: input.path,
85
+ ...report,
86
+ rule: rule ?? active.id,
87
+ severity: active.severity
88
+ });
89
+ const checked = (active, context) => Effect.suspend(() => {
90
+ const result = active.rule.check(context);
91
+ if (Effect.isEffect(result)) return result;
92
+ return Effect.void;
93
+ });
94
+ const runRule = (input) => (active) => {
95
+ const reports = [];
96
+ const context = {
97
+ filename: input.path,
98
+ kind: input.kind,
99
+ source: input.source,
100
+ options: active.options,
101
+ settings: input.settings,
102
+ project: input.project,
103
+ parseScript: input.parseScript,
104
+ report: (report) => {
105
+ reports.push(report);
106
+ }
107
+ };
108
+ return checked(active, context).pipe(Effect.catchCause((cause) => cause.pipe(failedWith(`fu4 rule ${active.id} failed on ${input.path}`), Effect.fail)), Effect.map(() => pipe(reports, Array.map(diagnosticOf(input, active)))), Effect.withSpan("fu4.rule", { attributes: {
109
+ "fu4.rule.id": active.id,
110
+ "code.file.path": input.path
111
+ } }));
112
+ };
113
+ const runFile = Effect.fn("fu4.runFile")(function* runFile(input) {
114
+ const active = pipe(input.rules, Array.filter(appliesTo(input.kind)));
115
+ const results = yield* Effect.forEach(active, runRule(input), CONCURRENT$1);
116
+ return Array.flatten(results);
117
+ });
118
+ // src/app/lint.ts
119
+ const CONCURRENT = { concurrency: "unbounded" };
120
+ const projectOf = (root, addon) => {
121
+ const parsed = /* @__PURE__ */ new Map();
122
+ const read = (file) => Option.fromNullishOr(addon.readText(root, file));
123
+ const parse = (file) => {
124
+ const source = pipe(read(file), Option.map((text) => sourceOf(sourceView(addon.parseText(text)))));
125
+ parsed.set(file, source);
126
+ return source;
127
+ };
128
+ return {
129
+ root,
130
+ exists: (file) => addon.pathExists(root, file),
131
+ read,
132
+ parse: (file) => Option.getOrElse(Option.fromNullishOr(parsed.get(file)), () => parse(file))
133
+ };
134
+ };
135
+ const scriptParser = (addon) => (language, text) => sourceOf(sourceView(addon.parseScript(language, text)));
136
+ const targetsOf = (config, files) => pipe(files, Array.filter((file) => Option.isSome(kindOf(file)) && !isIgnored(config)(file)));
137
+ const parsedFiles = Effect.fn("fu4.parse")(function* parsedFiles(root, targets) {
138
+ const parent = yield* traceparent;
139
+ return yield* callAddon({
140
+ addon: native,
141
+ name: "fu4",
142
+ files: targets.length,
143
+ call: (loaded) => loaded.parsePaths(root, targets, { traceparent: Option.getOrUndefined(parent) }),
144
+ failWith: failedWith
145
+ });
146
+ });
147
+ const lint = Effect.fn("fu4.lint")(function* lint(input) {
148
+ const config = flattenConfig(input.config ?? {});
149
+ const addon = yield* native;
150
+ const parsed = yield* parsedFiles(input.root, targetsOf(config, input.files));
151
+ const project = projectOf(input.root, addon);
152
+ const lintOne = (file) => Option.match(Option.fromUndefinedOr(file.source), {
153
+ onNone: () => Effect.succeed([notUtf8("fu4")(file.path)]),
154
+ onSome: (source) => runFile({
155
+ path: file.path,
156
+ kind: Option.getOrThrow(kindOf(file.path)),
157
+ source: sourceOf(sourceView(source)),
158
+ rules: activeRules(config)(file.path),
159
+ settings: config.settings ?? {},
160
+ project,
161
+ parseScript: scriptParser(addon)
162
+ })
163
+ });
164
+ const results = yield* Effect.forEach(parsed, lintOne, CONCURRENT);
165
+ return ordered(Array.flatten(results));
166
+ });
167
+ const kindFor = (input) => pipe(Option.fromNullishOr(input.kind), Option.orElse(() => kindOf(input.path)), Option.getOrElse(() => "workflow"));
168
+ const lintText = Effect.fn("fu4.lintText")(function* lintText(input) {
169
+ const config = flattenConfig(input.config ?? {});
170
+ const addon = yield* native;
171
+ const source = sourceOf(sourceView(addon.parseText(input.text)));
172
+ const results = yield* runFile({
173
+ path: input.path,
174
+ kind: kindFor(input),
175
+ source,
176
+ rules: activeRules(config)(input.path),
177
+ settings: config.settings ?? {},
178
+ project: projectOf(input.root, addon),
179
+ parseScript: scriptParser(addon)
180
+ });
181
+ return ordered(results);
182
+ });
183
+ // src/app/section.ts
184
+ const fu4Section = sectionOf({
185
+ name: "fu4",
186
+ prepare: flattenConfig,
187
+ fallback: {}
188
+ });
189
+ const workflowPathspecs = pathspecsOf({
190
+ defaults: [
191
+ ".github/workflows/*.yml",
192
+ ".github/workflows/*.yaml",
193
+ ":(glob)**/action.yml",
194
+ ":(glob)**/action.yaml",
195
+ ".github/dependabot.yml",
196
+ ".github/dependabot.yaml",
197
+ ".pre-commit-config.yaml",
198
+ ".pre-commit-hooks.yaml"
199
+ ],
200
+ unowned: [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"]
201
+ });
202
+ export { Fu4Error as a, lintText as i, workflowPathspecs as n, failedWith as o, lint as r, format as s, fu4Section as t };
203
+
204
+ //# sourceMappingURL=app-DR_5JsmN.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-DR_5JsmN.mjs","names":["Arr","Arr","Str","Rec","Str","Arr","CONCURRENT","Arr","Arr"],"sources":["../src/app/format.ts","../src/entities/rule/model/extend.ts","../src/entities/rule/model/resolve.ts","../src/entities/source/model/kind.ts","../src/shared/lib/errors.ts","../src/shared/native/index.ts","../src/features/run-rules/model/order.ts","../src/features/run-rules/model/run.ts","../src/app/lint.ts","../src/app/section.ts"],"sourcesContent":["import type { Diagnostic } from \"#/shared/config/index.ts\";\n\nexport const format = (diagnostic: Diagnostic): string =>\n `${diagnostic.path}:${String(diagnostic.line)}:${String(diagnostic.column)}: ${diagnostic.message} [${diagnostic.rule}]`;\n","import { layersOf, mergedLayers, mergedRecords } from \"@masseater.dev/lint-host\";\nimport { Array as Arr, pipe } from \"effect\";\n\nimport type { Fu4Config } from \"#/shared/config/index.ts\";\n\nexport const flattenConfig = (config: Fu4Config): Fu4Config => {\n const layers = layersOf(config);\n return {\n ...mergedLayers(layers),\n settings: mergedRecords(\n pipe(\n layers,\n Arr.map((layer) => layer.settings),\n ),\n ),\n };\n};\n","import { settingOf } from \"@masseater.dev/lint-host\";\nimport { matcher, selects } from \"@masseater.dev/path-kit\";\nimport { Array as Arr, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport type {\n Fu4Config,\n Override,\n Rule,\n RuleEntry,\n RuleOptions,\n Severity,\n} from \"#/shared/config/index.ts\";\n\nconst SEPARATOR = \"/\";\nconst START = 0;\n\nexport interface ActiveRule {\n readonly id: string;\n readonly rule: Rule;\n readonly severity: Exclude<Severity, \"off\">;\n readonly options: RuleOptions;\n}\n\ninterface Enabled {\n readonly id: string;\n readonly severity: Exclude<Severity, \"off\">;\n readonly options: RuleOptions;\n}\n\nconst enabled = ([id, entry]: readonly [string, RuleEntry]): readonly Enabled[] => {\n const { severity, options } = settingOf(entry);\n if (severity === \"off\") {\n return [];\n }\n return [{ id, severity, options }];\n};\n\nconst applies =\n (path: string) =>\n (override: Override): boolean =>\n selects(override.files)(path);\n\nexport const isIgnored =\n (config: Fu4Config) =>\n (path: string): boolean =>\n matcher(config.ignores ?? [])(path);\n\nexport const entriesFor =\n (config: Fu4Config) =>\n (path: string): Readonly<Record<string, RuleEntry>> => {\n const merged: Record<string, RuleEntry> = { ...config.rules };\n for (const override of pipe(config.overrides ?? [], Arr.filter(applies(path)))) {\n Object.assign(merged, override.rules);\n }\n return merged;\n };\n\nconst ruleOf =\n (config: Fu4Config) =>\n (id: string): Option.Option<Rule> =>\n pipe(\n Str.indexOf(SEPARATOR)(id),\n Option.flatMap((at) =>\n pipe(\n Rec.get(config.plugins ?? {}, Str.slice(START, at)(id)),\n Option.flatMap((plugin) => Rec.get(plugin.rules, Str.slice(at + SEPARATOR.length)(id))),\n ),\n ),\n );\n\nconst activate =\n (config: Fu4Config) =>\n (entry: Enabled): readonly ActiveRule[] =>\n pipe(\n ruleOf(config)(entry.id),\n Option.map((rule): ActiveRule => ({ ...entry, rule })),\n Option.toArray,\n );\n\nexport const activeRules =\n (config: Fu4Config) =>\n (path: string): readonly ActiveRule[] =>\n pipe(\n Rec.toEntries(entriesFor(config)(path)),\n Arr.flatMap(enabled),\n Arr.flatMap(activate(config)),\n );\n","import { baseName } from \"@masseater.dev/path-kit\";\nimport { Option, String as Str } from \"effect\";\n\nimport type { InputKind } from \"#/shared/config/index.ts\";\n\nconst WORKFLOWS = \".github/workflows/\";\nconst YAML = /\\.ya?ml$/u;\nconst ACTION = /^action\\.ya?ml$/u;\nconst DEPENDABOT = /^\\.github\\/dependabot\\.ya?ml$/u;\nconst PRE_COMMIT = /^\\.pre-commit-(?:config|hooks)\\.yaml$/u;\n\nexport const kindOf = (path: string): Option.Option<InputKind> => {\n if (DEPENDABOT.test(path)) {\n return Option.some(\"dependabot\");\n }\n if (PRE_COMMIT.test(path)) {\n return Option.some(\"pre-commit\");\n }\n if (ACTION.test(baseName(path))) {\n return Option.some(\"action\");\n }\n if (Str.includes(WORKFLOWS)(path) && YAML.test(path)) {\n return Option.some(\"workflow\");\n }\n return Option.none();\n};\n","import { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class Fu4Error extends taggedError<Fu4Error, { readonly brand: unique symbol }>()(\n \"Fu4Error\",\n {\n message: Schema.String,\n },\n) {}\n\nexport const failedWith =\n (message: string) =>\n (cause: unknown): Fu4Error =>\n Fu4Error.make({ message: `${message}: ${String(cause)}` });\n","import { exposes, loadAddon } from \"@masseater.dev/lint-host\";\nimport type { Effect } from \"effect\";\n\nimport { failedWith } from \"#/shared/lib/errors.ts\";\nimport type { Fu4Error } from \"#/shared/lib/errors.ts\";\n\nexport { CONCRETE, FLAG, NONE, SEMANTIC, sourceView } from \"./source.ts\";\nexport type { SourceView } from \"./source.ts\";\n\nexport interface ParsedFile {\n readonly path: string;\n readonly source?: Uint8Array;\n}\n\nexport interface Native {\n readonly parsePaths: (\n root: string,\n paths: readonly string[],\n options: { readonly traceparent: string | undefined },\n ) => readonly ParsedFile[];\n readonly parseText: (text: string) => Uint8Array;\n readonly parseScript: (language: string, text: string) => Uint8Array;\n readonly readText: (root: string, path: string) => string | null;\n readonly pathExists: (root: string, path: string) => boolean;\n readonly flushTelemetry: () => Promise<void>;\n}\n\nconst NATIVE_FUNCTIONS = [\n \"parsePaths\",\n \"parseText\",\n \"parseScript\",\n \"readText\",\n \"pathExists\",\n \"flushTelemetry\",\n] as const;\n\nconst isNative = exposes<Native>(NATIVE_FUNCTIONS);\n\nexport const native: Effect.Effect<Native, Fu4Error> = loadAddon({\n packageName: \"@r_masseater/fu4\",\n binary: \"fu4\",\n from: import.meta.url,\n isAddon: isNative,\n failWith: failedWith,\n});\n","import { Array as Arr, Order } from \"effect\";\n\nimport type { Diagnostic } from \"#/shared/config/index.ts\";\n\nconst byPosition: Order.Order<Diagnostic> = Order.combineAll([\n Order.mapInput(Order.String, (found: Diagnostic) => found.path),\n Order.mapInput(Order.Number, (found: Diagnostic) => found.line),\n Order.mapInput(Order.Number, (found: Diagnostic) => found.column),\n Order.mapInput(Order.String, (found: Diagnostic) => found.message),\n]);\n\nconst same = (left: Diagnostic, right: Diagnostic): boolean =>\n left.path === right.path &&\n left.line === right.line &&\n left.column === right.column &&\n left.message === right.message &&\n left.rule === right.rule;\n\nexport const ordered = (found: readonly Diagnostic[]): readonly Diagnostic[] =>\n Arr.dedupeWith(Arr.sort(found, byPosition), same);\n","import { Array as Arr, Effect, pipe } from \"effect\";\n\nimport type { ActiveRule } from \"#/entities/rule/index.ts\";\nimport type {\n Diagnostic,\n InputKind,\n Project,\n Report,\n RuleContext,\n ScriptLanguage,\n Source,\n} from \"#/shared/config/index.ts\";\nimport { failedWith } from \"#/shared/lib/errors.ts\";\nimport type { Fu4Error } from \"#/shared/lib/errors.ts\";\n\nexport interface FileInput {\n readonly path: string;\n readonly kind: InputKind;\n readonly source: Source;\n readonly rules: readonly ActiveRule[];\n readonly settings: Readonly<Record<string, unknown>>;\n readonly project: Project;\n readonly parseScript: (language: ScriptLanguage, text: string) => Source;\n}\n\nconst CONCURRENT = { concurrency: \"unbounded\" } as const;\n\nconst appliesTo =\n (kind: InputKind) =>\n ({ rule }: ActiveRule): boolean =>\n pipe(\n rule.meta.kinds ?? [\"workflow\"],\n Arr.some((each) => each === kind),\n );\n\nconst diagnosticOf =\n (input: FileInput, active: ActiveRule) =>\n ({ rule, ...report }: Report): Diagnostic => ({\n path: input.path,\n ...report,\n rule: rule ?? active.id,\n severity: active.severity,\n });\n\nconst checked = (active: ActiveRule, context: RuleContext): Effect.Effect<void> =>\n Effect.suspend(() => {\n const result = active.rule.check(context);\n if (Effect.isEffect(result)) {\n return result;\n }\n return Effect.void;\n });\n\nconst runRule =\n (input: FileInput) =>\n (active: ActiveRule): Effect.Effect<readonly Diagnostic[], Fu4Error> => {\n const reports: Report[] = [];\n const context: RuleContext = {\n filename: input.path,\n kind: input.kind,\n source: input.source,\n options: active.options,\n settings: input.settings,\n project: input.project,\n parseScript: input.parseScript,\n report: (report) => {\n reports.push(report);\n },\n };\n return checked(active, context).pipe(\n Effect.catchCause((cause) =>\n cause.pipe(failedWith(`fu4 rule ${active.id} failed on ${input.path}`), Effect.fail),\n ),\n Effect.map(() => pipe(reports, Arr.map(diagnosticOf(input, active)))),\n Effect.withSpan(\"fu4.rule\", {\n attributes: { \"fu4.rule.id\": active.id, \"code.file.path\": input.path },\n }),\n );\n };\n\nexport const runFile = Effect.fn(\"fu4.runFile\")(function* runFile(input: FileInput) {\n const active = pipe(input.rules, Arr.filter(appliesTo(input.kind)));\n const results = yield* Effect.forEach(active, runRule(input), CONCURRENT);\n return Arr.flatten(results);\n});\n","import { callAddon, notUtf8, traceparent } from \"@masseater.dev/lint-host\";\nimport { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport { activeRules, flattenConfig, isIgnored } from \"#/entities/rule/index.ts\";\nimport { kindOf, sourceOf } from \"#/entities/source/index.ts\";\nimport { ordered, runFile } from \"#/features/run-rules/index.ts\";\nimport type {\n Fu4Config,\n InputKind,\n Project,\n ScriptLanguage,\n Source,\n} from \"#/shared/config/index.ts\";\nimport { failedWith } from \"#/shared/lib/errors.ts\";\nimport { native, sourceView } from \"#/shared/native/index.ts\";\nimport type { Native, ParsedFile } from \"#/shared/native/index.ts\";\n\nexport interface LintInput {\n readonly root: string;\n readonly files: readonly string[];\n readonly config?: Fu4Config;\n}\n\nexport interface LintTextInput {\n readonly root: string;\n readonly path: string;\n readonly text: string;\n readonly kind?: InputKind;\n readonly config?: Fu4Config;\n}\n\nconst CONCURRENT = { concurrency: \"unbounded\" } as const;\n\nconst projectOf = (root: string, addon: Native): Project => {\n const parsed = new Map<string, Option.Option<Source>>();\n const read = (file: string): Option.Option<string> =>\n Option.fromNullishOr(addon.readText(root, file));\n const parse = (file: string): Option.Option<Source> => {\n const source = pipe(\n read(file),\n Option.map((text) => sourceOf(sourceView(addon.parseText(text)))),\n );\n parsed.set(file, source);\n return source;\n };\n return {\n root,\n exists: (file) => addon.pathExists(root, file),\n read,\n parse: (file) => Option.getOrElse(Option.fromNullishOr(parsed.get(file)), () => parse(file)),\n };\n};\n\nconst scriptParser =\n (addon: Native) =>\n (language: ScriptLanguage, text: string): Source =>\n sourceOf(sourceView(addon.parseScript(language, text)));\n\nconst targetsOf = (config: Fu4Config, files: readonly string[]): readonly string[] =>\n pipe(\n files,\n Arr.filter((file) => Option.isSome(kindOf(file)) && !isIgnored(config)(file)),\n );\n\nconst parsedFiles = Effect.fn(\"fu4.parse\")(function* parsedFiles(\n root: string,\n targets: readonly string[],\n) {\n const parent = yield* traceparent;\n return yield* callAddon({\n addon: native,\n name: \"fu4\",\n files: targets.length,\n call: (loaded): readonly ParsedFile[] =>\n loaded.parsePaths(root, targets, { traceparent: Option.getOrUndefined(parent) }),\n failWith: failedWith,\n });\n});\n\nexport const lint = Effect.fn(\"fu4.lint\")(function* lint(input: LintInput) {\n const config = flattenConfig(input.config ?? {});\n const addon = yield* native;\n const parsed = yield* parsedFiles(input.root, targetsOf(config, input.files));\n const project = projectOf(input.root, addon);\n const lintOne = (file: ParsedFile): ReturnType<typeof runFile> =>\n Option.match(Option.fromUndefinedOr(file.source), {\n onNone: () => Effect.succeed([notUtf8(\"fu4\")(file.path)]),\n onSome: (source) =>\n runFile({\n path: file.path,\n kind: Option.getOrThrow(kindOf(file.path)),\n source: sourceOf(sourceView(source)),\n rules: activeRules(config)(file.path),\n settings: config.settings ?? {},\n project,\n parseScript: scriptParser(addon),\n }),\n });\n const results = yield* Effect.forEach(parsed, lintOne, CONCURRENT);\n return ordered(Arr.flatten(results));\n});\n\nconst kindFor = (input: LintTextInput): InputKind =>\n pipe(\n Option.fromNullishOr(input.kind),\n Option.orElse(() => kindOf(input.path)),\n Option.getOrElse((): InputKind => \"workflow\"),\n );\n\nexport const lintText = Effect.fn(\"fu4.lintText\")(function* lintText(input: LintTextInput) {\n const config = flattenConfig(input.config ?? {});\n const addon = yield* native;\n const source = sourceOf(sourceView(addon.parseText(input.text)));\n const results = yield* runFile({\n path: input.path,\n kind: kindFor(input),\n source,\n rules: activeRules(config)(input.path),\n settings: config.settings ?? {},\n project: projectOf(input.root, addon),\n parseScript: scriptParser(addon),\n });\n return ordered(results);\n});\n","import { pathspecsOf, sectionOf } from \"@masseater.dev/lint-host\";\nimport type { PathspecRequest } from \"@masseater.dev/lint-host\";\n\nimport { flattenConfig } from \"#/entities/rule/index.ts\";\nimport type { Fu4Config } from \"#/shared/config/index.ts\";\n\nexport type PathspecInput = PathspecRequest<Fu4Config>;\n\nexport const fu4Section = sectionOf<Fu4Config>({\n name: \"fu4\",\n prepare: flattenConfig,\n fallback: {},\n});\n\nexport const workflowPathspecs = pathspecsOf({\n defaults: [\n \".github/workflows/*.yml\",\n \".github/workflows/*.yaml\",\n \":(glob)**/action.yml\",\n \":(glob)**/action.yaml\",\n \".github/dependabot.yml\",\n \".github/dependabot.yaml\",\n \".pre-commit-config.yaml\",\n \".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AAC,CAAC,UAAU,SAAS,OAAsB;CACzF,MAAM,SAAS,cAAc,MAAM,UAAU,CAAC,CAAC;CAC/C,MAAM,QAAQ,OAAO;CACrB,MAAM,SAAS,SAAS,WAAW,MAAM,UAAU,MAAM,IAAI,CAAC,CAAC;CAC/D,MAAM,UAAU,OAAO,QAAQ;EAC7B,MAAM,MAAM;EACZ,MAAM,QAAQ,KAAK;EACnB;EACA,OAAO,YAAY,MAAM,CAAC,CAAC,MAAM,IAAI;EACrC,UAAU,OAAO,YAAY,CAAC;EAC9B,SAAS,UAAU,MAAM,MAAM,KAAK;EACpC,aAAa,aAAa,KAAK;CACjC,CAAC;CACD,OAAO,QAAQ,OAAO;AACxB,CAAC;;ACnHD,MAAa,aAAa,UAAqB;CAC7C,MAAM;CACN,SAAS;CACT,UAAU,CAAC;AACb,CAAC;AAED,MAAa,oBAAoB,YAAY;CAC3C,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,SAAS,CAAC,qCAAqC,oCAAoC;AACrF,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { v as runCli$1 } from "./source-BRZXj75b.mjs";
2
+ import { n as workflowPathspecs, o as failedWith, r as lint, s as format, t as fu4Section } from "./app-DR_5JsmN.mjs";
3
+ // package.json
4
+ var version = "0.3.1";
5
+ var description = "The engine of a GitHub Actions linter: Rust parses workflows and TypeScript rules from its presets subpath check them, configured from vite.config.ts.";
6
+ // src/app/cli.ts
7
+ const runCli = () => {
8
+ runCli$1({
9
+ name: "fu4",
10
+ version,
11
+ description,
12
+ section: fu4Section,
13
+ pathspecs: workflowPathspecs,
14
+ lint,
15
+ format,
16
+ failWith: failedWith
17
+ });
18
+ };
19
+ export { runCli };
20
+
21
+ //# sourceMappingURL=cli-Cv5v6zny.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-Cv5v6zny.mjs","names":["manifest.version","manifest.description"],"sources":["../package.json","../src/app/cli.ts"],"sourcesContent":["","import { runCli as runLinter } from \"@masseater.dev/lint-host\";\nimport manifest from \"@r_masseater/fu4/package.json\" with { type: \"json\" };\n\nimport { failedWith } from \"#/shared/lib/errors.ts\";\n\nimport { format, lint } from \"./index.ts\";\nimport { fu4Section, workflowPathspecs } from \"./section.ts\";\n\nexport const runCli = (): void => {\n runLinter({\n name: \"fu4\",\n version: manifest.version,\n description: manifest.description,\n section: fu4Section,\n pathspecs: workflowPathspecs,\n lint,\n format,\n failWith: failedWith,\n });\n};\n"],"mappings":";;;;;;ACQA,MAAa,eAAqB;CAChC,SAAU;EACR,MAAM;EACGA;EACIC;EACb,SAAS;EACT,WAAW;EACX;EACA;EACA,UAAU;CACZ,CAAC;AACH"}
package/dist/cli.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import { enableCompileCache } from "node:module";
3
3
  // bin/fu4.ts
4
4
  enableCompileCache();
5
- const { runCli } = await import("./cli-Dc3I8PTz.mjs");
5
+ const { runCli } = await import("./cli-Cv5v6zny.mjs");
6
6
  runCli();
7
7
  export {};
8
8
 
@@ -1,7 +1,11 @@
1
- import { Effect, FileSystem, Option, Path } from "effect";
1
+ import { Effect, FileSystem, Option, Path, Schema } from "effect";
2
2
  type Severity = "off" | "warn" | "error";
3
3
  type RuleOptions = Readonly<Record<string, unknown>>;
4
4
  type RuleEntry = Severity | readonly [Severity] | readonly [Severity, RuleOptions];
5
+ interface PathspecRequest<Config> {
6
+ readonly config: Config;
7
+ readonly patterns?: readonly string[];
8
+ }
5
9
  interface Position {
6
10
  readonly line: number;
7
11
  readonly column: number;
@@ -106,5 +110,5 @@ interface Diagnostic {
106
110
  readonly detail?: string;
107
111
  readonly severity: Exclude<Severity, "off">;
108
112
  }
109
- export { YamlNode as _, Override as a, RuleOptions as b, Position as c, Rule as d, RuleContext as f, YamlKind as g, SyntaxNode as h, InputKind as i, Project as l, Source as m, Fu4Config as n, ParseError as o, ScriptLanguage as p, INPUT_KINDS as r, Plugin as s, Diagnostic as t, Report as u, YamlStyle as v, Severity as x, RuleEntry as y };
110
- //# sourceMappingURL=index-BBTwA_Cz.d.mts.map
113
+ export { Severity as S, YamlNode as _, Override as a, RuleEntry as b, Position as c, Rule as d, RuleContext as f, YamlKind as g, SyntaxNode as h, InputKind as i, Project as l, Source as m, Fu4Config as n, ParseError as o, ScriptLanguage as p, INPUT_KINDS as r, Plugin as s, Diagnostic as t, Report as u, YamlStyle as v, RuleOptions as x, PathspecRequest as y };
114
+ //# sourceMappingURL=index-DM3Q3-YV.d.mts.map
package/dist/index.d.mts CHANGED
@@ -1,5 +1,8 @@
1
- import { _ as YamlNode, a as Override, b as RuleOptions, c as Position, d as Rule, f as RuleContext, g as YamlKind, h as SyntaxNode, i as InputKind, l as Project, m as Source, n as Fu4Config, o as ParseError, p as ScriptLanguage, r as INPUT_KINDS, s as Plugin, t as Diagnostic, u as Report, v as YamlStyle, x as Severity, y as RuleEntry } from "./index-BBTwA_Cz.mjs";
1
+ import { S as Severity, _ as YamlNode, a as Override, b as RuleEntry, c as Position, d as Rule, f as RuleContext, g as YamlKind, h as SyntaxNode, i as InputKind, l as Project, m as Source, n as Fu4Config, o as ParseError, p as ScriptLanguage, r as INPUT_KINDS, s as Plugin, t as Diagnostic, u as Report, v as YamlStyle, x as RuleOptions, y as PathspecRequest } from "./index-DM3Q3-YV.mjs";
2
2
  import { Effect, Schema } from "effect";
3
+ interface Ignoring {
4
+ readonly ignores?: readonly string[] | undefined;
5
+ }
3
6
  export declare const format: (diagnostic: Diagnostic) => string;
4
7
  declare const Fu4Error_base: Schema.Class<Fu4Error, Schema.TaggedStruct<"Fu4Error", {
5
8
  readonly message: Schema.String;
@@ -21,12 +24,12 @@ interface LintTextInput {
21
24
  }
22
25
  export declare const lint: (input: LintInput) => Effect.Effect<readonly Diagnostic[], Fu4Error, never>;
23
26
  export declare const lintText: (input: LintTextInput) => Effect.Effect<readonly Diagnostic[], Fu4Error, never>;
27
+ type PathspecInput = PathspecRequest<Fu4Config>;
24
28
  export declare const fu4Section: (config: unknown) => Fu4Config;
25
- interface PathspecInput {
26
- readonly config: Fu4Config;
29
+ export declare const workflowPathspecs: ({ config, patterns }: {
30
+ readonly config: Ignoring;
27
31
  readonly patterns?: readonly string[];
28
- }
29
- export declare const workflowPathspecs: ({ config, patterns }: PathspecInput) => readonly string[];
32
+ }) => readonly string[];
30
33
  export declare const defineRule: (rule: Rule) => Rule;
31
34
  export declare const definePlugin: (plugin: Plugin) => Plugin;
32
35
  export { type Diagnostic, type Fu4Config, INPUT_KINDS, type InputKind, type LintInput, type LintTextInput, type Override, type ParseError, type PathspecInput, type Plugin, type Position, type Project, type Report, type Rule, type RuleContext, type RuleEntry, type RuleOptions, type ScriptLanguage, type Severity, type Source, type SyntaxNode, type YamlKind, type YamlNode, type YamlStyle };
package/dist/index.mjs CHANGED
@@ -1 +1,3 @@
1
- export { o as Fu4Error, t as INPUT_KINDS, c as definePlugin, l as defineRule, d as format, n as fu4Section, i as lint, a as lintText, r as workflowPathspecs } from "./app-DheTFmZd.mjs";
1
+ import { a as Fu4Error, i as lintText, n as workflowPathspecs, r as lint, s as format, t as fu4Section } from "./app-DR_5JsmN.mjs";
2
+ import { i as INPUT_KINDS, l as definePlugin, u as defineRule } from "./source-BRZXj75b.mjs";
3
+ export { Fu4Error, INPUT_KINDS, definePlugin, defineRule, format, fu4Section, lint, lintText, workflowPathspecs };