@r_masseater/fu4 0.0.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/LICENSE +87 -0
- package/README.md +100 -0
- package/dist/app-DheTFmZd.mjs +635 -0
- package/dist/app-DheTFmZd.mjs.map +1 -0
- package/dist/cli-Dc3I8PTz.mjs +15 -0
- package/dist/cli-Dc3I8PTz.mjs.map +1 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +9 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index-BBTwA_Cz.d.mts +110 -0
- package/dist/index.d.mts +33 -0
- package/dist/index.mjs +1 -0
- package/dist/vite.d.mts +7 -0
- package/dist/vite.mjs +1 -0
- package/logo.svg +9 -0
- package/package.json +74 -6
- package/skills/lint-workflows/SKILL.md +71 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-DheTFmZd.mjs","names":["taggedError","Rec","Str","Arr","DATA_FIRST_ARITY","Arr","Fn","Str","nodeServices","present","Fn","Bool","byPosition","Arr","Rec","WORD","EMPTY","Arr","SEPARATOR","Str","Arr","Rec","WORKFLOWS","Str","Arr","Arr","Str","Arr","CONCURRENT","Arr","Arr","Arr"],"sources":["../src/app/format.ts","../../lint-host/src/entities/rule/model/setting.ts","../../lint-host/src/shared/lib/target.ts","../../lint-host/src/features/build-addon/model/build.ts","../../lint-host/src/features/load-addon/model/load.ts","../../lint-host/src/features/load-addon/model/guard.ts","../../lint-host/src/features/run-cli/model/cli.ts","../../lint-host/src/shared/lib/present.ts","../../lint-host/src/shared/lib/trace.ts","../../lint-host/src/shared/lib/layers.ts","../../lint-host/src/shared/lib/words.ts","../src/entities/rule/model/define.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/source.ts","../src/shared/native/index.ts","../src/entities/source/model/source.ts","../src/features/run-rules/model/order.ts","../src/features/run-rules/model/run.ts","../src/app/lint.ts","../src/app/section.ts","../src/shared/config/types.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 { Array as Arr, Match, Option, Record as Rec, pipe } from \"effect\";\n\nexport type Severity = \"off\" | \"warn\" | \"error\";\n\nexport type RuleOptions = Readonly<Record<string, unknown>>;\n\nexport type RuleEntry = Severity | readonly [Severity] | readonly [Severity, RuleOptions];\n\nexport interface Setting {\n readonly severity: Severity;\n readonly options: RuleOptions;\n}\n\nconst NO_OPTIONS: RuleOptions = {};\n\nexport const settingOf = (entry: RuleEntry): Setting =>\n Match.value(entry).pipe(\n Match.when(Match.string, (severity): Setting => ({ severity, options: NO_OPTIONS })),\n Match.orElse(([severity, options]): Setting => ({\n severity,\n options: options ?? NO_OPTIONS,\n })),\n );\n\nconst optionsOf = (entry: RuleEntry): Option.Option<RuleOptions> =>\n Match.value(entry).pipe(\n Match.when(Match.string, () => Option.none()),\n Match.orElse(([, options]) => Option.fromUndefinedOr(options)),\n );\n\nconst overridden = (earlier: RuleEntry, later: RuleEntry): RuleEntry =>\n pipe(\n optionsOf(later),\n Option.orElse(() => optionsOf(earlier)),\n Option.match({\n onNone: () => later,\n onSome: (options): RuleEntry => [settingOf(later).severity, options],\n }),\n );\n\nexport const mergedRules = (\n layers: readonly (Readonly<Record<string, RuleEntry>> | undefined)[],\n): Readonly<Record<string, RuleEntry>> => {\n const merged: Record<string, RuleEntry> = {};\n for (const [name, later] of pipe(\n layers,\n Arr.flatMap((layer) => Rec.toEntries(layer ?? {})),\n )) {\n merged[name] = pipe(\n Rec.get(merged, name),\n Option.match({\n onNone: () => later,\n onSome: (earlier) => overridden(earlier, later),\n }),\n );\n }\n return merged;\n};\n","import { Match } from \"effect\";\n\nconst abiOf = (platform: string): string =>\n Match.value(platform).pipe(\n Match.when(\"linux\", () => \"-gnu\"),\n Match.when(\"win32\", () => \"-msvc\"),\n Match.orElse(() => \"\"),\n );\n\nexport const platformTarget = `${process.platform}-${process.arch}${abiOf(process.platform)}`;\n\nexport const addonFileOf = (binary: string): string => `${binary}.${platformTarget}.node`;\n","import { runMain } from \"@effect/platform-node/NodeRuntime\";\nimport { layer as nodeServices } from \"@effect/platform-node/NodeServices\";\nimport { Effect, FileSystem, Path, Record as Rec, Schema, String as Str } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport { addonFileOf } from \"#/shared/lib/target.ts\";\n\nconst taggedError = Schema.TaggedError;\n\nclass AddonBuildFailed extends taggedError<AddonBuildFailed, { readonly brand: unique symbol }>()(\n \"AddonBuildFailed\",\n { message: Schema.String },\n) {}\n\nconst LIBRARY: Readonly<Record<string, (name: string) => string>> = {\n linux: (name) => `lib${name}.so`,\n darwin: (name) => `lib${name}.dylib`,\n win32: (name) => `${name}.dll`,\n};\n\nconst SUCCESS = 0;\n\nexport interface AddonBuild {\n readonly crate: string;\n readonly binary: string;\n readonly packageDir: string;\n readonly workspaceDir: string;\n}\n\nconst cargo = Effect.fn(\"cargo\")(function* cargo(crate: string, workspace: string) {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const exitCode = yield* spawner.exitCode(\n ChildProcess.make(\"cargo\", [\"build\", \"--release\", \"--locked\", \"-p\", crate], {\n cwd: workspace,\n stdout: \"inherit\",\n stderr: \"inherit\",\n }),\n );\n const failure = AddonBuildFailed.make({ message: `cargo exited with ${String(exitCode)}` });\n yield* Effect.when(\n Effect.fail(failure),\n Effect.sync(() => Number(exitCode) !== SUCCESS),\n );\n});\n\nconst build = Effect.fn(\"buildAddon\")(function* build(options: AddonBuild) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const library = yield* Effect.fromOption(Rec.get(LIBRARY, process.platform)).pipe(\n Effect.mapError(() =>\n AddonBuildFailed.make({ message: `no native build for ${process.platform}` }),\n ),\n );\n yield* cargo(options.crate, options.workspaceDir);\n const output = path.join(options.packageDir, \"native\");\n yield* fileSystem.makeDirectory(output, { recursive: true });\n const built = library(Str.replaceAll(\"-\", \"_\")(options.crate));\n yield* fileSystem.copyFile(\n path.join(options.workspaceDir, \"target\", \"release\", built),\n path.join(output, addonFileOf(options.binary)),\n );\n});\n\nexport const buildAddon = (options: AddonBuild): void => {\n runMain(build(options).pipe(Effect.provide(nodeServices)));\n};\n","import { createRequire } from \"node:module\";\n\nimport { Effect } from \"effect\";\n\nimport type { FailWith } from \"#/shared/lib/fail.ts\";\nimport { addonFileOf, platformTarget } from \"#/shared/lib/target.ts\";\n\nexport interface AddonSource<Addon, Failure> {\n readonly packageName: string;\n readonly binary: string;\n readonly from: string;\n readonly isAddon: (value: unknown) => value is Addon;\n readonly failWith: FailWith<Failure>;\n}\n\nexport const loadAddon = <Addon, Failure>({\n packageName,\n binary,\n from,\n isAddon,\n failWith,\n}: AddonSource<Addon, Failure>): Effect.Effect<Addon, Failure> => {\n const requireFrom = createRequire(from);\n const loadFrom = (specifier: string): Effect.Effect<unknown, Failure> =>\n Effect.try({\n try: (): unknown => requireFrom(specifier),\n catch: failWith(`could not load ${specifier}`),\n });\n return loadFrom(`${packageName}-${platformTarget}`).pipe(\n Effect.catchCause(() => loadFrom(`${packageName}/native/${addonFileOf(binary)}`)),\n Effect.filterOrFail(isAddon, (found) =>\n failWith(`no ${binary} addon for ${platformTarget}`)(found),\n ),\n );\n};\n\nexport interface Telemetered {\n readonly flushTelemetry: () => Promise<void>;\n}\n\nexport interface AddonCall<Addon extends Telemetered, Result, Failure> {\n readonly addon: Effect.Effect<Addon, Failure>;\n readonly name: string;\n readonly files: number;\n readonly call: (addon: Addon) => Result;\n readonly failWith: FailWith<Failure>;\n}\n\nexport const callAddon = <Addon extends Telemetered, Result, Failure>({\n addon,\n name,\n files,\n call,\n failWith,\n}: AddonCall<Addon, Result, Failure>): Effect.Effect<Result, Failure> =>\n addon.pipe(\n Effect.flatMap((loaded) =>\n Effect.try({ try: () => call(loaded), catch: failWith(`${name} could not lint`) }).pipe(\n Effect.tap(() => Effect.promise(() => loaded.flushTelemetry())),\n ),\n ),\n Effect.withSpan(`${name}.native`, { attributes: { [`${name}.files`]: files } }),\n );\n","import { Array as Arr, Predicate, pipe } from \"effect\";\n\nconst hasFunction =\n (value: unknown) =>\n (name: string): boolean =>\n Predicate.hasProperty(value, name) && Predicate.isFunction(value[name]);\n\nexport const exposes =\n <Addon>(names: readonly Extract<keyof Addon, string>[]) =>\n (value: unknown): value is Addon =>\n pipe(names, Arr.every(hasFunction(value)));\n","import { runMain } from \"@effect/platform-node/NodeRuntime\";\nimport { layer as nodeServices } from \"@effect/platform-node/NodeServices\";\nimport {\n Array as Arr,\n Console,\n Effect,\n FileSystem,\n Function as Fn,\n Layer,\n Option,\n Path,\n String as Str,\n pipe,\n} from \"effect\";\nimport { FetchHttpClient } from \"effect/http\";\nimport { Otlp, OtlpSerialization } from \"effect/observability\";\nimport type { PlatformError } from \"effect/PlatformError\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport type { FailWith } from \"#/shared/lib/fail.ts\";\n\nconst CONFIG_FILES = [\"vite.config.ts\", \"vite.config.mts\", \"vite.config.js\", \"vite.config.mjs\"];\nconst FAILED = 1;\nconst DATA_FIRST_ARITY = 2;\nconst ARGUMENTS_START = 2;\n\nexport interface Reported {\n readonly severity: string;\n}\n\nexport interface LintCall<Config, Failure> {\n readonly root: string;\n readonly files: readonly string[];\n readonly projectFiles: readonly string[];\n readonly config: Config;\n readonly read: (file: string) => Effect.Effect<string, Failure>;\n}\n\nexport interface PathspecRequest<Config> {\n readonly config: Config;\n readonly patterns?: readonly string[];\n}\n\nexport interface SectionSource<Config, Failure> {\n readonly name: string;\n readonly section: (config: unknown) => Config;\n readonly failWith: FailWith<Failure>;\n}\n\nexport interface Cli<Config, Found extends Reported, Failure> extends SectionSource<\n Config,\n Failure\n> {\n readonly pathspecs: (request: PathspecRequest<Config>) => readonly string[];\n readonly lint: (call: LintCall<Config, Failure>) => Effect.Effect<readonly Found[], Failure>;\n readonly format: (found: Found) => string;\n}\n\nexport interface ToolCall<Config> {\n readonly root: string;\n readonly config: Config;\n readonly args: readonly string[];\n}\n\nexport interface Tool<Config, Found, Failure> extends SectionSource<Config, Failure> {\n readonly scan: (call: ToolCall<Config>) => Effect.Effect<readonly Found[], Failure>;\n readonly format: (found: Found) => string;\n}\n\ntype CliServices = FileSystem.FileSystem | Path.Path | ChildProcessSpawner.ChildProcessSpawner;\n\nconst readSectionIn = <Config, Failure>(\n source: SectionSource<Config, Failure>,\n root: string,\n): Effect.Effect<Config, Failure, FileSystem.FileSystem | Path.Path> =>\n Effect.gen(function* readConfig() {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const found = yield* pipe(\n CONFIG_FILES,\n Arr.map((name) => path.join(root, name)),\n Effect.filter((file) => fileSystem.exists(file).pipe(Effect.orElseSucceed(() => false))),\n );\n const loaded = yield* Option.match(Arr.head(found), {\n onNone: () => Effect.succeed<unknown>({}),\n onSome: (file) =>\n Effect.tryPromise({\n try: () => resolveConfigFromFile(file),\n catch: source.failWith(`could not load ${file}`),\n }),\n });\n return source.section(loaded);\n }).pipe(Effect.withSpan(`${source.name}.config`));\n\n/** @internal */\nexport const readSection: {\n (\n root: string,\n ): <Config, Failure>(\n source: SectionSource<Config, Failure>,\n ) => Effect.Effect<Config, Failure, FileSystem.FileSystem | Path.Path>;\n <Config, Failure>(\n source: SectionSource<Config, Failure>,\n root: string,\n ): Effect.Effect<Config, Failure, FileSystem.FileSystem | Path.Path>;\n} = Fn.dual(DATA_FIRST_ARITY, readSectionIn);\n\nconst trackedFiles = (\n root: string,\n pathspecs: readonly string[],\n): Effect.Effect<readonly string[], PlatformError, ChildProcessSpawner.ChildProcessSpawner> =>\n Effect.gen(function* listFiles() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const output = yield* spawner.string(\n ChildProcess.make(\n \"git\",\n [\"ls-files\", \"-co\", \"--exclude-standard\", \"-z\", \"--\", ...pathspecs],\n { cwd: root },\n ),\n );\n return pipe(Str.split(output, \"\\0\"), Arr.filter(Str.isNonEmpty));\n });\n\nconst requestOf = <Config>(config: Config, patterns: readonly string[]): PathspecRequest<Config> =>\n Arr.match(patterns, {\n onEmpty: () => ({ config }),\n onNonEmpty: (given) => ({ config, patterns: given }),\n });\n\nconst hasError = (found: readonly Reported[]): boolean =>\n pipe(\n found,\n Arr.some(({ severity }) => severity === \"error\"),\n );\n\nconst failWhen = (failed: boolean): Effect.Effect<void> =>\n Effect.when(\n Effect.sync(() => {\n process.exitCode = FAILED;\n }),\n Effect.succeed(failed),\n ).pipe(Effect.asVoid);\n\nconst printAll = <Found>(\n found: readonly Found[],\n format: (found: Found) => string,\n): Effect.Effect<void> =>\n Arr.match(found, {\n onEmpty: () => Effect.void,\n onNonEmpty: (all) => Console.log(pipe(all, Arr.map(format), Arr.join(\"\\n\"))),\n });\n\nconst readerIn = <Failure>(\n root: string,\n failWith: FailWith<Failure>,\n): Effect.Effect<\n (file: string) => Effect.Effect<string, Failure>,\n never,\n FileSystem.FileSystem | Path.Path\n> =>\n Effect.gen(function* reader() {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n return (file: string): Effect.Effect<string, Failure> =>\n fileSystem\n .readFileString(path.resolve(root, file))\n .pipe(Effect.mapError(failWith(`could not read ${file}`)));\n });\n\nconst mainOf = <Config, Found extends Reported, Failure>(\n cli: Cli<Config, Found, Failure>,\n): Effect.Effect<void, Failure | PlatformError, CliServices> =>\n Effect.gen(function* main() {\n const root = process.cwd();\n const config = yield* readSectionIn(cli, root);\n const patterns = process.argv.slice(ARGUMENTS_START);\n const pathspecs = cli.pathspecs(requestOf(config, patterns));\n const { files, projectFiles } = yield* Effect.all(\n {\n files: trackedFiles(root, pathspecs).pipe(Effect.withSpan(`${cli.name}.files`)),\n projectFiles: trackedFiles(root, []).pipe(Effect.withSpan(`${cli.name}.project`)),\n },\n { concurrency: \"unbounded\" },\n );\n const read = yield* readerIn(root, cli.failWith);\n const found = yield* cli.lint({ root, files, projectFiles, config, read });\n yield* printAll(found, cli.format);\n yield* failWhen(hasError(found));\n });\n\nconst toolMainOf = <Config, Found, Failure>(\n tool: Tool<Config, Found, Failure>,\n): Effect.Effect<void, Failure | PlatformError, CliServices> =>\n Effect.gen(function* main() {\n const root = process.cwd();\n const config = yield* readSectionIn(tool, root);\n const found = yield* tool.scan({ root, config, args: process.argv.slice(ARGUMENTS_START) });\n yield* printAll(found, tool.format);\n yield* failWhen(Arr.isReadonlyArrayNonEmpty(found));\n });\n\nconst runTraced = <Failure>(\n name: string,\n program: Effect.Effect<void, Failure, CliServices>,\n): void => {\n const services = Otlp.layerFromConfig({ resource: { serviceName: name } }).pipe(\n Layer.provide(OtlpSerialization.layerJson),\n Layer.provide(FetchHttpClient.layer),\n Layer.provideMerge(nodeServices),\n );\n runMain(program.pipe(Effect.provide(services)));\n};\n\nexport const runCli = <Config, Found extends Reported, Failure>(\n cli: Cli<Config, Found, Failure>,\n): void => {\n runTraced(cli.name, mainOf(cli));\n};\n\nexport const runTool = <Config, Found, Failure>(tool: Tool<Config, Found, Failure>): void => {\n runTraced(tool.name, toolMainOf(tool));\n};\n","import { Function as Fn, Option } from \"effect\";\n\nconst DATA_FIRST_ARITY = 2;\n\nexport const present: {\n <Value, Fields extends object>(\n build: (value: Value) => Fields,\n ): (value: Option.Option<Value>) => Partial<Fields>;\n <Value, Fields extends object>(\n value: Option.Option<Value>,\n build: (value: Value) => Fields,\n ): Partial<Fields>;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n <Value, Fields extends object>(\n value: Option.Option<Value>,\n build: (value: Value) => Fields,\n ): Partial<Fields> => Option.match(value, { onNone: (): Partial<Fields> => ({}), onSome: build }),\n);\n","import { Array as Arr, Boolean as Bool, Effect, Order } from \"effect\";\nimport type { Option } from \"effect\";\n\nconst SAMPLED = \"01\";\nconst NOT_SAMPLED = \"00\";\n\nexport interface Positioned {\n readonly path: string;\n readonly line: number;\n readonly column?: number;\n}\n\nconst LINE_START = 0;\n\nconst flagsOf = (sampled: boolean): string =>\n Bool.match(sampled, { onFalse: () => NOT_SAMPLED, onTrue: () => SAMPLED });\n\nexport const traceparent: Effect.Effect<Option.Option<string>> = Effect.currentSpan.pipe(\n Effect.map((span) => `00-${span.traceId}-${span.spanId}-${flagsOf(span.sampled)}`),\n Effect.option,\n);\n\nconst byPosition: Order.Order<Positioned> = Order.combine(\n Order.mapInput(Order.String, (found: Positioned) => found.path),\n Order.combine(\n Order.mapInput(Order.Number, (found: Positioned) => found.line),\n Order.mapInput(Order.Number, (found: Positioned) => found.column ?? LINE_START),\n ),\n);\n\nexport const sortByPosition = <Found extends Positioned>(found: readonly Found[]): Found[] =>\n Arr.sort(found, byPosition);\n","import { Array as Arr, Record as Rec, pipe } from \"effect\";\n\nexport interface Layer<Plugin, Entry, Override> {\n readonly plugins?: Readonly<Record<string, Plugin>>;\n readonly rules?: Readonly<Record<string, Entry>>;\n readonly ignores?: readonly string[];\n readonly overrides?: readonly Override[];\n}\n\nexport interface Merged<Plugin, Entry, Override> {\n readonly plugins: Readonly<Record<string, Plugin>>;\n readonly rules: Readonly<Record<string, Entry>>;\n readonly ignores: readonly string[];\n readonly overrides: readonly Override[];\n}\n\nexport const mergedRecords = <Value>(\n records: readonly (Readonly<Record<string, Value>> | undefined)[],\n): Readonly<Record<string, Value>> =>\n pipe(\n records,\n Arr.flatMap((record) => Rec.toEntries(record ?? {})),\n Rec.fromEntries,\n );\n\nexport const layersOf = <Config extends { readonly extends?: readonly Config[] }>(\n config: Config,\n): readonly Omit<Config, \"extends\">[] => {\n const { extends: bases = [], ...own } = config;\n return [...pipe(bases, Arr.flatMap(layersOf)), own];\n};\n\nexport const mergedLayers = <Plugin, Entry, Override>(\n layers: readonly Layer<Plugin, Entry, Override>[],\n): Merged<Plugin, Entry, Override> => ({\n plugins: mergedRecords(\n pipe(\n layers,\n Arr.map((layer) => layer.plugins),\n ),\n ),\n rules: mergedRecords(\n pipe(\n layers,\n Arr.map((layer) => layer.rules),\n ),\n ),\n ignores: pipe(\n layers,\n Arr.flatMap((layer) => layer.ignores ?? []),\n ),\n overrides: pipe(\n layers,\n Arr.flatMap((layer) => layer.overrides ?? []),\n ),\n});\n","import { Option } from \"effect\";\n\nconst WORD = 4;\nconst EMPTY = 0;\n\nexport const aligned = (buffer: Uint8Array): Uint8Array =>\n Option.match(\n Option.liftPredicate(buffer, ({ byteOffset }) => byteOffset % WORD === EMPTY),\n {\n onNone: () => Uint8Array.from(buffer),\n onSome: (value) => value,\n },\n );\n\nexport const wordAt =\n (words: Uint32Array) =>\n (index: number): number =>\n words[index] ?? EMPTY;\n","import type { Plugin, Rule } from \"#/shared/config/index.ts\";\n\nexport const defineRule = (rule: Rule): Rule => rule;\n\nexport const definePlugin = (plugin: Plugin): Plugin => plugin;\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 { Array as Arr, Option, Record as Rec, String as Str, pipe } from \"effect\";\nimport { minimatch } from \"minimatch\";\n\nimport type {\n Fu4Config,\n Override,\n Rule,\n RuleEntry,\n RuleOptions,\n Severity,\n} from \"#/shared/config/index.ts\";\n\nconst NEGATION = \"!\";\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 matches =\n (path: string) =>\n (pattern: string): boolean =>\n minimatch(path, pattern, { dot: true });\n\nconst negated = Str.startsWith(NEGATION);\n\nconst applies =\n (path: string) =>\n (override: Override): boolean =>\n pipe(\n override.files,\n Arr.filter((pattern) => !negated(pattern)),\n Arr.some(matches(path)),\n ) &&\n !pipe(\n override.files,\n Arr.filter(negated),\n Arr.map(Str.slice(NEGATION.length)),\n Arr.some(matches(path)),\n );\n\nexport const isIgnored =\n (config: Fu4Config) =>\n (path: string): boolean =>\n pipe(config.ignores ?? [], Arr.some(matches(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 { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport type { InputKind } from \"#/shared/config/index.ts\";\n\nconst SEPARATOR = \"/\";\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\nconst baseName = (path: string): string =>\n pipe(\n Str.split(SEPARATOR)(path),\n Arr.last,\n Option.getOrElse(() => path),\n );\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 { aligned, wordAt } from \"@masseater.dev/lint-host\";\nimport { Option } from \"effect\";\n\nconst WORD = 4;\nconst EMPTY = 0;\nconst NEXT = 1;\nconst STRING_WORDS = 2;\nexport const NONE = 4_294_967_295;\nexport const HEADER_WORDS = 8;\nexport const SEMANTIC_WORDS = 8;\nexport const CONCRETE_WORDS = 8;\nexport const ERROR_WORDS = 3;\n\nexport const HEADER = {\n version: 0,\n semanticCount: 1,\n semanticRoot: 2,\n concreteCount: 3,\n concreteRoot: 4,\n childCount: 5,\n errorCount: 6,\n stringCount: 7,\n} as const;\n\nexport const SEMANTIC = {\n kind: 0,\n tag: 1,\n value: 2,\n style: 3,\n line: 4,\n column: 5,\n childStart: 6,\n childCount: 7,\n} as const;\n\nexport const CONCRETE = {\n kind: 0,\n flags: 1,\n start: 2,\n end: 3,\n field: 4,\n parent: 5,\n childStart: 6,\n childCount: 7,\n} as const;\n\nexport const FLAG = { named: 1, error: 2, missing: 4, extra: 8 } as const;\n\nexport interface SourceView {\n readonly semanticCount: number;\n readonly semanticRoot: Option.Option<number>;\n readonly concreteCount: number;\n readonly concreteRoot: Option.Option<number>;\n readonly errorCount: number;\n readonly semantic: (id: number, field: number) => number;\n readonly concrete: (id: number, field: number) => number;\n readonly child: (index: number) => number;\n readonly error: (index: number, field: number) => number;\n readonly stringAt: (index: number) => string;\n readonly text: string;\n}\n\nconst utf16 = new TextDecoder(\"utf-16le\");\n\nconst rootOf = (value: number): Option.Option<number> =>\n Option.liftPredicate(value, (id) => id !== NONE);\n\ninterface Layout {\n readonly semanticCount: number;\n readonly concreteCount: number;\n readonly errorCount: number;\n readonly semanticAt: number;\n readonly concreteAt: number;\n readonly childAt: number;\n readonly errorAt: number;\n readonly spanAt: number;\n readonly blobAt: number;\n}\n\nconst layoutOf = (header: Uint32Array): Layout => {\n const semanticCount = wordAt(header)(HEADER.semanticCount);\n const concreteCount = wordAt(header)(HEADER.concreteCount);\n const errorCount = wordAt(header)(HEADER.errorCount);\n const semanticAt = HEADER_WORDS;\n const concreteAt = semanticAt + semanticCount * SEMANTIC_WORDS;\n const childAt = concreteAt + concreteCount * CONCRETE_WORDS;\n const errorAt = childAt + wordAt(header)(HEADER.childCount);\n const spanAt = errorAt + errorCount * ERROR_WORDS;\n const blobAt = (spanAt + wordAt(header)(HEADER.stringCount) * STRING_WORDS) * WORD;\n return {\n semanticCount,\n concreteCount,\n errorCount,\n semanticAt,\n concreteAt,\n childAt,\n errorAt,\n spanAt,\n blobAt,\n };\n};\n\nconst stringsOf = (\n words: Uint32Array,\n blob: Uint8Array,\n spanAt: number,\n): ((index: number) => string) => {\n const cache = new Map<number, string>();\n const decode = (index: number): string => {\n const offset = wordAt(words)(spanAt + index * STRING_WORDS) * STRING_WORDS;\n const length = wordAt(words)(spanAt + index * STRING_WORDS + NEXT) * STRING_WORDS;\n const value = utf16.decode(blob.subarray(offset, offset + length));\n cache.set(index, value);\n return value;\n };\n return (index) => Option.getOrElse(Option.fromNullishOr(cache.get(index)), () => decode(index));\n};\n\nexport const sourceView = (raw: Uint8Array): SourceView => {\n const buffer = aligned(raw);\n const header = new Uint32Array(buffer.buffer, buffer.byteOffset, HEADER_WORDS);\n const layout = layoutOf(header);\n const words = new Uint32Array(buffer.buffer, buffer.byteOffset, layout.blobAt / WORD);\n const stringAt = stringsOf(words, buffer.subarray(layout.blobAt), layout.spanAt);\n return {\n semanticCount: layout.semanticCount,\n semanticRoot: rootOf(wordAt(header)(HEADER.semanticRoot)),\n concreteCount: layout.concreteCount,\n concreteRoot: rootOf(wordAt(header)(HEADER.concreteRoot)),\n errorCount: layout.errorCount,\n semantic: (id, field) => wordAt(words)(layout.semanticAt + id * SEMANTIC_WORDS + field),\n concrete: (id, field) => wordAt(words)(layout.concreteAt + id * CONCRETE_WORDS + field),\n child: (index) => wordAt(words)(layout.childAt + index),\n error: (index, field) => wordAt(words)(layout.errorAt + index * ERROR_WORDS + field),\n stringAt,\n text: stringAt(EMPTY),\n };\n};\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, Option, String as Str, pipe } from \"effect\";\n\nimport type {\n ParseError,\n Position,\n Source,\n SyntaxNode,\n YamlKind,\n YamlNode,\n YamlStyle,\n} from \"#/shared/config/index.ts\";\nimport { CONCRETE, FLAG, NONE, SEMANTIC } from \"#/shared/native/index.ts\";\nimport type { SourceView } from \"#/shared/native/index.ts\";\n\nconst FIRST = 1;\nconst FIRST_LINE = 0;\nconst HALF = 2;\nconst BIT = 2;\nconst SET = 1;\nconst ERROR_FIELD = { line: 0, column: 1, message: 2 } as const;\nconst LINE_BREAK = /\\r\\n|\\r|\\n/u;\nconst NEWLINES = /\\n/gu;\n\nconst KINDS: readonly YamlKind[] = [\"scalar\", \"sequence\", \"mapping\", \"alias\"];\nconst STYLES: readonly YamlStyle[] = [\n \"plain\",\n \"single-quoted\",\n \"double-quoted\",\n \"literal\",\n \"folded\",\n];\n\nconst pick = <Value>(values: readonly Value[], index: number, fallback: Value): Value =>\n pipe(\n Arr.get(values, index),\n Option.getOrElse(() => fallback),\n );\n\nconst lazy = <Value>(make: () => Value): (() => Value) => {\n let made: Option.Option<Value> = Option.none();\n return () =>\n pipe(\n made,\n Option.getOrElse(() => {\n const value = make();\n made = Option.some(value);\n return value;\n }),\n );\n};\n\nconst memo = <Node>(make: (id: number) => Node): ((id: number) => Node) => {\n const made = new Map<number, Node>();\n return (id) => made.getOrInsertComputed(id, () => make(id));\n};\n\nconst times = <Value>(count: number, make: (index: number) => Value): readonly Value[] =>\n Array.from({ length: count }, (_empty, index) => make(index));\n\nconst childrenOf =\n <Node>(view: SourceView, at: (id: number) => Node) =>\n (start: number, count: number): readonly Node[] =>\n times(count, (offset) => at(view.child(start + offset)));\n\nconst yamlTree = (view: SourceView): ((id: number) => YamlNode) => {\n const at: (id: number) => YamlNode = memo((id) => {\n const field = (name: keyof typeof SEMANTIC): number => view.semantic(id, SEMANTIC[name]);\n const children = lazy(() => childrenOf(view, at)(field(\"childStart\"), field(\"childCount\")));\n return {\n id,\n kind: pick(KINDS, field(\"kind\"), \"scalar\"),\n tag: view.stringAt(field(\"tag\")),\n value: view.stringAt(field(\"value\")),\n style: pick(STYLES, field(\"style\"), \"plain\"),\n line: field(\"line\"),\n column: field(\"column\"),\n get children(): readonly YamlNode[] {\n return children();\n },\n };\n });\n return at;\n};\n\nconst hasFlag = (flags: number, flag: number): boolean => Math.floor(flags / flag) % BIT === SET;\n\nconst present = (index: number): Option.Option<number> =>\n Option.liftPredicate(index, (value) => value !== NONE);\n\nconst syntaxNode =\n (view: SourceView, at: (id: number) => SyntaxNode) =>\n (id: number): SyntaxNode => {\n const field = (name: keyof typeof CONCRETE): number => view.concrete(id, CONCRETE[name]);\n const flags = field(\"flags\");\n const start = field(\"start\");\n const end = field(\"end\");\n const children = lazy(() => childrenOf(view, at)(field(\"childStart\"), field(\"childCount\")));\n return {\n id,\n type: view.stringAt(field(\"kind\")),\n named: hasFlag(flags, FLAG.named),\n isError: hasFlag(flags, FLAG.error),\n isMissing: hasFlag(flags, FLAG.missing),\n isExtra: hasFlag(flags, FLAG.extra),\n start,\n end,\n field: pipe(present(field(\"field\")), Option.map(view.stringAt), Option.getOrUndefined),\n get parent(): SyntaxNode | undefined {\n return pipe(present(field(\"parent\")), Option.map(at), Option.getOrUndefined);\n },\n get children(): readonly SyntaxNode[] {\n return children();\n },\n get namedChildren(): readonly SyntaxNode[] {\n return pipe(\n children(),\n Arr.filter((child) => child.named),\n );\n },\n get text(): string {\n return Str.slice(start, end)(view.text);\n },\n };\n };\n\nconst syntaxTree = (view: SourceView): ((id: number) => SyntaxNode) => {\n const at: (id: number) => SyntaxNode = memo((id) => syntaxNode(view, at)(id));\n return at;\n};\n\nconst lineStartsOf = (text: string): readonly number[] => [\n FIRST_LINE,\n ...Array.from(Str.matchAll(NEWLINES)(text), (match) => (match.index ?? FIRST_LINE) + FIRST),\n];\n\nconst lineAt = (starts: readonly number[], offset: number): number => {\n let low = FIRST_LINE;\n let high = starts.length - FIRST;\n while (low < high) {\n const middle = Math.ceil((low + high) / HALF);\n if ((starts[middle] ?? FIRST_LINE) <= offset) {\n low = middle;\n } else {\n high = middle - FIRST;\n }\n }\n return low;\n};\n\nconst positionIn = (text: string): ((offset: number) => Position) => {\n const starts = lineStartsOf(text);\n return (offset) => {\n const line = lineAt(starts, offset);\n return { line: line + FIRST, column: offset - (starts[line] ?? FIRST_LINE) + FIRST };\n };\n};\n\nconst errorsOf = (view: SourceView): readonly ParseError[] =>\n times(view.errorCount, (index) => ({\n line: view.error(index, ERROR_FIELD.line),\n column: view.error(index, ERROR_FIELD.column),\n message: view.stringAt(view.error(index, ERROR_FIELD.message)),\n }));\n\nexport const sourceOf = (view: SourceView): Source => {\n const yaml = yamlTree(view);\n const syntax = syntaxTree(view);\n const lines = lazy(() => Str.split(LINE_BREAK)(view.text));\n return {\n text: view.text,\n yaml: pipe(view.semanticRoot, Option.map(yaml), Option.getOrUndefined),\n syntax: pipe(view.concreteRoot, Option.map(syntax), Option.getOrUndefined),\n errors: errorsOf(view),\n get lines(): readonly string[] {\n return lines();\n },\n positionOf: positionIn(view.text),\n };\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 Effect.fail(failedWith(`fu4 rule ${active.id} failed on ${input.path}`)(cause)),\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, 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 runFile({\n path: file.path,\n kind: Option.getOrThrow(kindOf(file.path)),\n source: sourceOf(sourceView(file.source)),\n rules: activeRules(config)(file.path),\n settings: config.settings ?? {},\n project,\n parseScript: scriptParser(addon),\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 { Array as Arr, Option, Predicate, pipe } from \"effect\";\n\nimport { flattenConfig } from \"#/entities/rule/index.ts\";\nimport type { Fu4Config } from \"#/shared/config/index.ts\";\n\nconst WORKFLOWS = [\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 \".pre-commit-hooks.yaml\",\n];\n\nconst NOT_OWNED = [\":(exclude,attr:linguist-vendored)\", \":(exclude,attr:linguist-generated)\"];\n\nconst hasSection = (value: unknown): value is { readonly fu4: Fu4Config } =>\n Predicate.hasProperty(value, \"fu4\") && Predicate.isObject(value.fu4);\n\nexport const fu4Section = (config: unknown): Fu4Config =>\n pipe(\n Option.liftPredicate(config, hasSection),\n Option.map((value) => flattenConfig(value.fu4)),\n Option.getOrElse((): Fu4Config => ({})),\n );\n\nexport interface PathspecInput {\n readonly config: Fu4Config;\n readonly patterns?: readonly string[];\n}\n\nexport const workflowPathspecs = ({\n config,\n patterns = WORKFLOWS,\n}: PathspecInput): readonly string[] => [\n ...patterns,\n ...NOT_OWNED,\n ...pipe(\n config.ignores ?? [],\n Arr.map((glob) => `:(glob,exclude)${glob}`),\n ),\n];\n","import type { RuleEntry, RuleOptions, Severity } from \"@masseater.dev/lint-host\";\nimport type { Effect, Option } from \"effect\";\n\nexport type { RuleEntry, RuleOptions, Severity } from \"@masseater.dev/lint-host\";\n\nexport interface Position {\n readonly line: number;\n readonly column: number;\n}\n\nexport type YamlKind = \"scalar\" | \"sequence\" | \"mapping\" | \"alias\";\n\nexport type YamlStyle = \"plain\" | \"single-quoted\" | \"double-quoted\" | \"literal\" | \"folded\";\n\nexport interface YamlNode {\n readonly id: number;\n readonly kind: YamlKind;\n readonly tag: string;\n readonly value: string;\n readonly style: YamlStyle;\n readonly line: number;\n readonly column: number;\n readonly children: readonly YamlNode[];\n}\n\nexport interface SyntaxNode {\n readonly id: number;\n readonly type: string;\n readonly named: boolean;\n readonly isError: boolean;\n readonly isMissing: boolean;\n readonly isExtra: boolean;\n readonly start: number;\n readonly end: number;\n readonly field: string | undefined;\n readonly parent: SyntaxNode | undefined;\n readonly children: readonly SyntaxNode[];\n readonly namedChildren: readonly SyntaxNode[];\n readonly text: string;\n}\n\nexport interface ParseError {\n readonly line: number;\n readonly column: number;\n readonly message: string;\n}\n\nexport interface Source {\n readonly text: string;\n readonly yaml: YamlNode | undefined;\n readonly syntax: SyntaxNode | undefined;\n readonly errors: readonly ParseError[];\n readonly lines: readonly string[];\n readonly positionOf: (offset: number) => Position;\n}\n\nexport const INPUT_KINDS = [\"workflow\", \"action\", \"dependabot\", \"pre-commit\"] as const;\nexport type InputKind = (typeof INPUT_KINDS)[number];\n\nexport type ScriptLanguage = \"bash\" | \"powershell\";\n\nexport interface Report {\n readonly message: string;\n readonly line: number;\n readonly column: number;\n readonly length?: number;\n readonly detail?: string;\n readonly rule?: string;\n}\n\nexport interface Project {\n readonly root: string;\n readonly exists: (path: string) => boolean;\n readonly read: (path: string) => Option.Option<string>;\n readonly parse: (path: string) => Option.Option<Source>;\n}\n\nexport interface RuleContext {\n readonly filename: string;\n readonly kind: InputKind;\n readonly source: Source;\n readonly options: RuleOptions;\n readonly settings: Readonly<Record<string, unknown>>;\n readonly project: Project;\n readonly parseScript: (language: ScriptLanguage, text: string) => Source;\n readonly report: (report: Report) => void;\n}\n\nexport interface Rule {\n readonly meta: {\n readonly description: string;\n readonly kinds?: readonly InputKind[];\n readonly docs?: string;\n };\n readonly check: (context: RuleContext) => void | Effect.Effect<void>;\n}\n\nexport interface Plugin {\n readonly rules: Readonly<Record<string, Rule>>;\n}\n\nexport interface Override {\n readonly files: readonly string[];\n readonly rules: Readonly<Record<string, RuleEntry>>;\n}\n\nexport interface Fu4Config {\n readonly extends?: readonly Fu4Config[];\n readonly plugins?: Readonly<Record<string, Plugin>>;\n readonly rules?: Readonly<Record<string, RuleEntry>>;\n readonly settings?: Readonly<Record<string, unknown>>;\n readonly overrides?: readonly Override[];\n readonly ignores?: readonly string[];\n}\n\nexport interface Diagnostic {\n readonly path: string;\n readonly line: number;\n readonly column: number;\n readonly length?: number;\n readonly rule: string;\n readonly message: string;\n readonly detail?: string;\n readonly severity: Exclude<Severity, \"off\">;\n}\n"],"mappings":";;;;;;;;;;AAEA,MAAa,UAAU,eACrB,GAAG,WAAW,KAAK,GAAG,OAAO,WAAW,IAAI,EAAE,GAAG,OAAO,WAAW,MAAM,EAAE,IAAI,WAAW,QAAQ,IAAI,WAAW,KAAK;;ACUxH,MAAM,aAA0B,CAAC;AAEjC,MAAa,aAAa,UACxB,MAAM,MAAM,KAAK,CAAC,CAAC,KACjB,MAAM,KAAK,MAAM,SAAS,cAAuB;CAAE;CAAU,SAAS;AAAW,EAAE,GACnF,MAAM,QAAQ,CAAC,UAAU,cAAuB;CAC9C;CACA,SAAS,WAAW;AACtB,EAAE,CACJ;;ACpBF,MAAM,SAAS,aACb,MAAM,MAAM,QAAQ,CAAC,CAAC,KACpB,MAAM,KAAK,eAAe,MAAM,GAChC,MAAM,KAAK,eAAe,OAAO,GACjC,MAAM,aAAa,EAAE,CACvB;AAEF,MAAa,iBAAiB,GAAG,QAAQ,SAAS,GAAG,QAAQ,OAAO,MAAM,QAAQ,QAAQ;AAE1F,MAAa,eAAe,WAA2B,GAAG,OAAO,GAAG,eAAe;;ACJnF,MAAMA,gBAAc,OAAO;AAE3B,IAAM,mBAAN,cAA+BA,cAAiE,CAAC,CAC/F,oBACA,EAAE,SAAS,OAAO,OAAO,CAC3B,CAAC,CAAC,CAAC;AAEH,MAAM,UAA8D;CAClE,QAAQ,SAAS,MAAM,KAAK;CAC5B,SAAS,SAAS,MAAM,KAAK;CAC7B,QAAQ,SAAS,GAAG,KAAK;AAC3B;AAEA,MAAM,UAAU;AAShB,MAAM,QAAQ,OAAO,GAAG,OAAO,CAAC,CAAC,UAAU,MAAM,OAAe,WAAmB;CAEjF,MAAM,WAAW,QAAO,OADD,oBAAoB,oBAAA,CACX,SAC9B,aAAa,KAAK,SAAS;EAAC;EAAS;E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u as runCli$1 } from "./app-DheTFmZd.mjs";
|
|
2
|
+
// src/app/cli.ts
|
|
3
|
+
const runCli = () => {
|
|
4
|
+
runCli$1({
|
|
5
|
+
name: "fu4",
|
|
6
|
+
section: fu4Section,
|
|
7
|
+
pathspecs: workflowPathspecs,
|
|
8
|
+
lint,
|
|
9
|
+
format,
|
|
10
|
+
failWith: failedWith
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
export { runCli };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=cli-Dc3I8PTz.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-Dc3I8PTz.mjs","names":[],"sources":["../src/app/cli.ts"],"sourcesContent":["import { runCli as runLinter } from \"@masseater.dev/lint-host\";\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 section: fu4Section,\n pathspecs: workflowPathspecs,\n lint,\n format,\n failWith: failedWith,\n });\n};\n"],"mappings":";;AAOA,MAAa,eAAqB;CAChC,SAAU;EACR,MAAM;EACN,SAAS;EACT,WAAW;EACX;EACA;EACA,UAAU;CACZ,CAAC;AACH"}
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/cli.mjs
ADDED
package/dist/cli.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":[],"sources":["../bin/fu4.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { enableCompileCache } from \"node:module\";\n\nenableCompileCache();\n\nconst { runCli } = await import(\"#/app/cli.ts\");\n\nrunCli();\n"],"mappings":";;;AAGA,mBAAmB;AAEnB,MAAM,EAAE,WAAW,MAAM,OAAO;AAEhC,OAAO"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Effect, FileSystem, Option, Path } from "effect";
|
|
2
|
+
type Severity = "off" | "warn" | "error";
|
|
3
|
+
type RuleOptions = Readonly<Record<string, unknown>>;
|
|
4
|
+
type RuleEntry = Severity | readonly [Severity] | readonly [Severity, RuleOptions];
|
|
5
|
+
interface Position {
|
|
6
|
+
readonly line: number;
|
|
7
|
+
readonly column: number;
|
|
8
|
+
}
|
|
9
|
+
type YamlKind = "scalar" | "sequence" | "mapping" | "alias";
|
|
10
|
+
type YamlStyle = "plain" | "single-quoted" | "double-quoted" | "literal" | "folded";
|
|
11
|
+
interface YamlNode {
|
|
12
|
+
readonly id: number;
|
|
13
|
+
readonly kind: YamlKind;
|
|
14
|
+
readonly tag: string;
|
|
15
|
+
readonly value: string;
|
|
16
|
+
readonly style: YamlStyle;
|
|
17
|
+
readonly line: number;
|
|
18
|
+
readonly column: number;
|
|
19
|
+
readonly children: readonly YamlNode[];
|
|
20
|
+
}
|
|
21
|
+
interface SyntaxNode {
|
|
22
|
+
readonly id: number;
|
|
23
|
+
readonly type: string;
|
|
24
|
+
readonly named: boolean;
|
|
25
|
+
readonly isError: boolean;
|
|
26
|
+
readonly isMissing: boolean;
|
|
27
|
+
readonly isExtra: boolean;
|
|
28
|
+
readonly start: number;
|
|
29
|
+
readonly end: number;
|
|
30
|
+
readonly field: string | undefined;
|
|
31
|
+
readonly parent: SyntaxNode | undefined;
|
|
32
|
+
readonly children: readonly SyntaxNode[];
|
|
33
|
+
readonly namedChildren: readonly SyntaxNode[];
|
|
34
|
+
readonly text: string;
|
|
35
|
+
}
|
|
36
|
+
interface ParseError {
|
|
37
|
+
readonly line: number;
|
|
38
|
+
readonly column: number;
|
|
39
|
+
readonly message: string;
|
|
40
|
+
}
|
|
41
|
+
interface Source {
|
|
42
|
+
readonly text: string;
|
|
43
|
+
readonly yaml: YamlNode | undefined;
|
|
44
|
+
readonly syntax: SyntaxNode | undefined;
|
|
45
|
+
readonly errors: readonly ParseError[];
|
|
46
|
+
readonly lines: readonly string[];
|
|
47
|
+
readonly positionOf: (offset: number) => Position;
|
|
48
|
+
}
|
|
49
|
+
declare const INPUT_KINDS: readonly ["workflow", "action", "dependabot", "pre-commit"];
|
|
50
|
+
type InputKind = (typeof INPUT_KINDS)[number];
|
|
51
|
+
type ScriptLanguage = "bash" | "powershell";
|
|
52
|
+
interface Report {
|
|
53
|
+
readonly message: string;
|
|
54
|
+
readonly line: number;
|
|
55
|
+
readonly column: number;
|
|
56
|
+
readonly length?: number;
|
|
57
|
+
readonly detail?: string;
|
|
58
|
+
readonly rule?: string;
|
|
59
|
+
}
|
|
60
|
+
interface Project {
|
|
61
|
+
readonly root: string;
|
|
62
|
+
readonly exists: (path: string) => boolean;
|
|
63
|
+
readonly read: (path: string) => Option.Option<string>;
|
|
64
|
+
readonly parse: (path: string) => Option.Option<Source>;
|
|
65
|
+
}
|
|
66
|
+
interface RuleContext {
|
|
67
|
+
readonly filename: string;
|
|
68
|
+
readonly kind: InputKind;
|
|
69
|
+
readonly source: Source;
|
|
70
|
+
readonly options: RuleOptions;
|
|
71
|
+
readonly settings: Readonly<Record<string, unknown>>;
|
|
72
|
+
readonly project: Project;
|
|
73
|
+
readonly parseScript: (language: ScriptLanguage, text: string) => Source;
|
|
74
|
+
readonly report: (report: Report) => void;
|
|
75
|
+
}
|
|
76
|
+
interface Rule {
|
|
77
|
+
readonly meta: {
|
|
78
|
+
readonly description: string;
|
|
79
|
+
readonly kinds?: readonly InputKind[];
|
|
80
|
+
readonly docs?: string;
|
|
81
|
+
};
|
|
82
|
+
readonly check: (context: RuleContext) => void | Effect.Effect<void>;
|
|
83
|
+
}
|
|
84
|
+
interface Plugin {
|
|
85
|
+
readonly rules: Readonly<Record<string, Rule>>;
|
|
86
|
+
}
|
|
87
|
+
interface Override {
|
|
88
|
+
readonly files: readonly string[];
|
|
89
|
+
readonly rules: Readonly<Record<string, RuleEntry>>;
|
|
90
|
+
}
|
|
91
|
+
interface Fu4Config {
|
|
92
|
+
readonly extends?: readonly Fu4Config[];
|
|
93
|
+
readonly plugins?: Readonly<Record<string, Plugin>>;
|
|
94
|
+
readonly rules?: Readonly<Record<string, RuleEntry>>;
|
|
95
|
+
readonly settings?: Readonly<Record<string, unknown>>;
|
|
96
|
+
readonly overrides?: readonly Override[];
|
|
97
|
+
readonly ignores?: readonly string[];
|
|
98
|
+
}
|
|
99
|
+
interface Diagnostic {
|
|
100
|
+
readonly path: string;
|
|
101
|
+
readonly line: number;
|
|
102
|
+
readonly column: number;
|
|
103
|
+
readonly length?: number;
|
|
104
|
+
readonly rule: string;
|
|
105
|
+
readonly message: string;
|
|
106
|
+
readonly detail?: string;
|
|
107
|
+
readonly severity: Exclude<Severity, "off">;
|
|
108
|
+
}
|
|
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
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
|
+
export declare const format: (diagnostic: Diagnostic) => string;
|
|
4
|
+
declare const Fu4Error_base: Schema.Class<Fu4Error, Schema.TaggedStruct<"Fu4Error", {
|
|
5
|
+
readonly message: Schema.String;
|
|
6
|
+
}>, import("effect/Cause").YieldableError & {
|
|
7
|
+
readonly brand: unique symbol;
|
|
8
|
+
}>;
|
|
9
|
+
export declare class Fu4Error extends Fu4Error_base {}
|
|
10
|
+
interface LintInput {
|
|
11
|
+
readonly root: string;
|
|
12
|
+
readonly files: readonly string[];
|
|
13
|
+
readonly config?: Fu4Config;
|
|
14
|
+
}
|
|
15
|
+
interface LintTextInput {
|
|
16
|
+
readonly root: string;
|
|
17
|
+
readonly path: string;
|
|
18
|
+
readonly text: string;
|
|
19
|
+
readonly kind?: InputKind;
|
|
20
|
+
readonly config?: Fu4Config;
|
|
21
|
+
}
|
|
22
|
+
export declare const lint: (input: LintInput) => Effect.Effect<readonly Diagnostic[], Fu4Error, never>;
|
|
23
|
+
export declare const lintText: (input: LintTextInput) => Effect.Effect<readonly Diagnostic[], Fu4Error, never>;
|
|
24
|
+
export declare const fu4Section: (config: unknown) => Fu4Config;
|
|
25
|
+
interface PathspecInput {
|
|
26
|
+
readonly config: Fu4Config;
|
|
27
|
+
readonly patterns?: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
export declare const workflowPathspecs: ({ config, patterns }: PathspecInput) => readonly string[];
|
|
30
|
+
export declare const defineRule: (rule: Rule) => Rule;
|
|
31
|
+
export declare const definePlugin: (plugin: Plugin) => Plugin;
|
|
32
|
+
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 };
|
|
33
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
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";
|
package/dist/vite.d.mts
ADDED
package/dist/vite.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/logo.svg
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" xmlns:c2pa="http://c2pa.org/manifest">
|
|
2
|
+
<rect width="512" height="512" fill="#2A3F73"/>
|
|
3
|
+
<path d="M186 214 C 160 150, 168 104, 196 98 C 222 94, 232 150, 226 206 Z" fill="#F6F1E4"/>
|
|
4
|
+
<path d="M286 206 C 280 150, 290 94, 316 98 C 344 104, 352 150, 326 214 Z" fill="#F6F1E4"/>
|
|
5
|
+
<path d="M188 116 C 190 100, 204 96, 212 104 C 206 112, 196 118, 188 116 Z" fill="#14182B"/>
|
|
6
|
+
<path d="M300 104 C 308 96, 322 100, 324 116 C 316 118, 306 112, 300 104 Z" fill="#14182B"/>
|
|
7
|
+
<path d="M100 330 C 92 230, 170 186, 256 186 C 342 186, 420 230, 412 330 C 404 392, 330 410, 256 410 C 182 410, 108 392, 100 330 Z" fill="#F6F1E4"/>
|
|
8
|
+
<path d="M388 250 l22 -18 l-2 26 l26 -6 l-14 22 l24 10 l-26 8 Z" fill="#E98A3C"/>
|
|
9
|
+
<metadata><c2pa:manifest>AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTo2NWI3YmUyMC02YWUxLTQ4YTUtYTQ4Yi01YWY0OTM1ODQ2ZTEAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaIag6uZ82GIr3PtZIf70BIUAAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDoyYzM0OTYyZS01ZjRhLTQxNzItYmJmNC1iNjAxYWI3NTg4NzJscmVsYXRpb25zaGlwaHBhcmVudE9mAA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
2
|
+
"name": "@r_masseater/fu4",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "The engine of a GitHub Actions linter: Rust parses workflows and TypeScript rules from @r_masseater/fu4-presets check them, configured from vite.config.ts.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"actionlint",
|
|
7
|
+
"github-actions",
|
|
8
|
+
"lint",
|
|
9
|
+
"tanstack-intent",
|
|
10
|
+
"vite-plus"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/masseater/masseater.dev/tree/main/libs/fu4#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/masseater/masseater.dev/issues"
|
|
15
|
+
},
|
|
2
16
|
"license": "MIT",
|
|
3
17
|
"repository": {
|
|
4
18
|
"type": "git",
|
|
5
19
|
"url": "git+https://github.com/masseater/masseater.dev.git",
|
|
6
20
|
"directory": "libs/fu4"
|
|
7
21
|
},
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"url": "https://github.com/masseater/masseater.dev/issues"
|
|
22
|
+
"bin": {
|
|
23
|
+
"fu4": "./dist/cli.mjs"
|
|
11
24
|
},
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
"files": [
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"dist",
|
|
28
|
+
"logo.svg",
|
|
29
|
+
"skills/lint-workflows"
|
|
30
|
+
],
|
|
31
|
+
"type": "module",
|
|
32
|
+
"imports": {
|
|
33
|
+
"#/*": "./src/*"
|
|
34
|
+
},
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/index.d.mts",
|
|
38
|
+
"default": "./dist/index.mjs"
|
|
39
|
+
},
|
|
40
|
+
"./vite": {
|
|
41
|
+
"types": "./dist/vite.d.mts",
|
|
42
|
+
"default": "./dist/vite.mjs"
|
|
43
|
+
},
|
|
44
|
+
"./package.json": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public",
|
|
48
|
+
"provenance": true
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@effect/platform-node": "^4.1.4",
|
|
52
|
+
"minimatch": "^11.0.9"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@masseater.dev/lint-host": "0.0.0",
|
|
56
|
+
"@r_masseater/vitest-otlp": "0.2.1",
|
|
57
|
+
"@types/node": "26.6.6",
|
|
58
|
+
"effect": "4.1.4",
|
|
59
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@8.3.8000",
|
|
60
|
+
"vite-plus": "1.7.0",
|
|
61
|
+
"yaml": "2.9.1"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"effect": "^4.1.2",
|
|
65
|
+
"vite": "*",
|
|
66
|
+
"vite-plus": ">=1.5.0"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": "v26.13.1"
|
|
70
|
+
},
|
|
71
|
+
"native": {
|
|
72
|
+
"binary": "fu4",
|
|
73
|
+
"targets": [
|
|
74
|
+
"linux-x64-gnu",
|
|
75
|
+
"win32-x64-msvc"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"optionalDependencies": {
|
|
79
|
+
"@r_masseater/fu4-linux-x64-gnu": "0.2.0",
|
|
80
|
+
"@r_masseater/fu4-win32-x64-msvc": "0.2.0"
|
|
81
|
+
},
|
|
82
|
+
"scripts": {}
|
|
15
83
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lint-workflows
|
|
3
|
+
description: >
|
|
4
|
+
Use when setting up @r_masseater/fu4 in vite.config.ts, running it on GitHub Actions
|
|
5
|
+
workflows, actions, Dependabot or pre-commit configs, or writing a rule or plugin for it.
|
|
6
|
+
Covers extends, rules, settings, overrides, ignores, the CLI and the rule API.
|
|
7
|
+
metadata:
|
|
8
|
+
type: core
|
|
9
|
+
library: "@r_masseater/fu4"
|
|
10
|
+
library_version: 0.1.0
|
|
11
|
+
sources:
|
|
12
|
+
- src/app/index.ts
|
|
13
|
+
- src/shared/config/types.ts
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# lint-workflows
|
|
17
|
+
|
|
18
|
+
fu4 is the engine of a GitHub Actions linter. Rust parses each file once; TypeScript rules read
|
|
19
|
+
the parsed trees without copying them. fu4 has no rules of its own, so a config without plugins
|
|
20
|
+
reports nothing. The official rules are in `@r_masseater/fu4-presets`, which ships its own skill for choosing
|
|
21
|
+
them and fixing what they report.
|
|
22
|
+
|
|
23
|
+
## Setup
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
vp add -D @r_masseater/fu4 @r_masseater/fu4-presets
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import "@r_masseater/fu4/vite";
|
|
31
|
+
import { recommended } from "@r_masseater/fu4-presets";
|
|
32
|
+
import { defineConfig } from "vite-plus";
|
|
33
|
+
|
|
34
|
+
export default defineConfig({
|
|
35
|
+
fu4: {
|
|
36
|
+
extends: [recommended()],
|
|
37
|
+
rules: { "zizmor/stale-action-refs": "warn" },
|
|
38
|
+
overrides: [
|
|
39
|
+
{ files: [".github/workflows/vendored-*.yml"], rules: { "actionlint/shellcheck": "off" } },
|
|
40
|
+
],
|
|
41
|
+
ignores: [".github/workflows/generated-*.yml"],
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- `extends` lists configs to start from. The config's own keys come after them and win.
|
|
47
|
+
- `rules` sets a rule to `"error"`, `"warn"` or `"off"`, or to `[severity, options]`.
|
|
48
|
+
- `settings` holds values every rule can read, keyed by plugin name.
|
|
49
|
+
- `overrides` gives `files` globs their own `rules`.
|
|
50
|
+
- `ignores` lists globs of files the CLI does not lint.
|
|
51
|
+
|
|
52
|
+
## Running
|
|
53
|
+
|
|
54
|
+
Run `fu4` in the repository root. It lints the workflows git tracks or would add under
|
|
55
|
+
`.github/workflows`, the `action.yml` files, `.github/dependabot.yml` and the pre-commit configs at
|
|
56
|
+
the root, prints `path:line:column: message [rule]`, and exits with 1 when it reports anything.
|
|
57
|
+
Pass pathspecs to lint other files: `fu4 'ci/**/*.yml'`. From code, `lint({ root, files, config })`
|
|
58
|
+
returns the diagnostics as an Effect.
|
|
59
|
+
|
|
60
|
+
## Writing rules
|
|
61
|
+
|
|
62
|
+
Define a rule with `defineRule({ meta, check })` and register it in a plugin with
|
|
63
|
+
`definePlugin({ rules })`. Put the plugin under `plugins` and turn its rules on in `rules`.
|
|
64
|
+
|
|
65
|
+
- `meta.kinds` lists the inputs the rule reads: `workflow` (the default), `action`, `dependabot`
|
|
66
|
+
or `pre-commit`.
|
|
67
|
+
- `check(context)` reads `context.source` (the YAML tree, the tree-sitter tree and the lines),
|
|
68
|
+
`context.options`, `context.settings` and `context.project`, which reads other files of the
|
|
69
|
+
repository. It may return an Effect.
|
|
70
|
+
- `context.parseScript(language, text)` parses a `run:` script as `bash` or `powershell`.
|
|
71
|
+
- `context.report({ message, line, column })` reports a finding.
|