Skip to content

wip-feat: clippy-style rule system refactor with diagnostic improvements and schema verification - #2

Merged
tomdavidson merged 5 commits into
mainfrom
feat/rule-system-refactor
Apr 30, 2026
Merged

wip-feat: clippy-style rule system refactor with diagnostic improvements and schema verification#2
tomdavidson merged 5 commits into
mainfrom
feat/rule-system-refactor

Conversation

@tomdavidson

Copy link
Copy Markdown
Owner

No description provided.

Parts A-D of the rule system refactor:

Part A - Diagnostic improvements:
- Add DiagnosticLabel, primary_span, SuggestedFix, TextEdit, Applicability
- Create fix.rs with apply_fixes infrastructure
- Rename span -> primary_span across codebase

Part B - CLI improvements:
- Route text output to stdout (was stderr)
- Make 'lint' the default subcommand (actlint [paths] works)
- Add stdin detection with --type flag
- Document exit codes (0=clean, 1=errors, 2=operational)

Part C - Rule refactor:
- Add declare_rule! macro and register_rules! registry
- Port all rules to 26 flat files with clippy-style architecture
- Add LintConfig with disabled_rules, disabled_namespaces, schema config
- Replace legacy dispatch with ALL_RULES loop
- Delete action/ and workflow/ subdirectories
- Update fuzz harnesses for new dispatch
- Add shared test harness (run_rule, assert_rule_clean)

Part D - Test coverage:
- All 26 rules have clean-case tests
- workflow_expression_contexts: new tests (was zero coverage)
- Diagnostic-quality assertions on key rules
- 12 CLI integration tests (assert_cmd + predicates)
- 264 total tests (220 unit + 32 integration + 12 CLI)

Rule IDs migrated from 'workflow/X' and 'action/X' to 'semantic/workflow-X'
and 'semantic/action-X' namespace format.
- Make moon the primary command interface, cargo as fallback
- Add command reference table (moon vs cargo)
- Add 'How to add a new rule' section with declare_rule! walkthrough
- Document exit codes, stdin support, default subcommand
- Update project structure to reflect flat rule files
- Preserve fuzz testing documentation
@tomdavidson tomdavidson changed the title feat: clippy-style rule system refactor with diagnostic improvements and schema verification wip-feat: clippy-style rule system refactor with diagnostic improvements and schema verification Mar 29, 2026
Moon was trying to download node_depman_toolchain WASM plugin for
the javascript/pnpm config, hitting a 502 from GitHub releases.
This is a pure Rust project with no JS dependencies.

- Remove javascript, node, pnpm, bun sections from .moon/toolchains.yml
- Default cache-pnpm to false in setup action
- Remove dead pnpm store cache step
No JS dependencies in this repo. Explicitly pass cache-pnpm: false
to every setup action call so moon does not attempt to download the
node_depman_toolchain WASM plugin.

Reverts changes to .github/actions/setup/action.yml from previous
commit; the fix is in the callers instead.
@tomdavidson
tomdavidson merged commit 3f2b4d8 into main Apr 30, 2026
4 of 8 checks passed
@tomdavidson
tomdavidson deleted the feat/rule-system-refactor branch April 30, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant