Skip to content

fix(lint): add #[non_exhaustive] to 44 public enums + wildcard arms#207

Merged
forkwright merged 1 commit intomainfrom
fix/lint-non-exhaustive-enums
Apr 20, 2026
Merged

fix(lint): add #[non_exhaustive] to 44 public enums + wildcard arms#207
forkwright merged 1 commit intomainfrom
fix/lint-non-exhaustive-enums

Conversation

@forkwright
Copy link
Copy Markdown
Owner

Summary

  • Adds #[non_exhaustive] to 44 public enums across 16 crates (aitesis, akouo-core, apotheke, ergasia, exousia, horismos, kathodos, komide, kritike, paroche, prostheke, syndesis, syntaxis, theatron-core, themelion, zetesis) to clear RUST/non-exhaustive-enum warnings
  • Wildcard match arms added in 2 cross-crate sites that destructure horismos::MediaType and horismos::WatcherMode (both in kathodos)
  • Within-crate matches unchanged — #[non_exhaustive] only forces wildcard arms across crate boundaries

Rationale

Forward-compat hygiene for the internal closed-system workspace: adding a variant to a public enum later won't break downstream match exhaustiveness in semver-stable releases.

Cross-crate break resolution

Both breaks hit horismos::* enums consumed from kathodos. Chose unreachable!() with file/line context — these are state-machine/classification enums where forgetting to update a downstream matcher is a programming error, not a runtime condition to silently absorb.

  • kathodos/src/import/identify.rs::resolve_media_type — maps horismos::MediaType to themelion::MediaType; added _ => unreachable!("unhandled horismos::MediaType variant in resolve_media_type — ...")
  • kathodos/src/scanner/watcher.rs::detect_watcher_mode_at — branches on horismos::WatcherMode; same pattern

Scope

  • Part of the harmonia 77-warning cleanup arc unblocking 05e cutover (non-exhaustive-enum slice)
  • Does NOT touch: 16 unwrap, 14 TOML, 3 indexing-slicing sites (sibling agents)

Test plan

  • cargo check --workspace --tests --examples --benches passes
  • cargo nextest run --workspace — 1075 tests pass (3 skipped)
  • kanon lint . | grep RUST/non-exhaustive-enum returns 0 matches (down from 44)
  • kanon gate expected to still fail on 33 pre-existing warnings (TOML, unwrap, indexing-slicing, clippy too_many_arguments, stale clippy::type_complexity expectations) — none introduced by this PR

Gate state

kanon gate --stamp → FAIL on 2 pre-existing steps (cargo clippy, kanon lint), all tied to the other 33 warnings owned by sibling cleanup agents. Verified by git-stash comparison that every clippy/lint error reproduces on pristine branch base. No Gate-Passed trailer per task spec.

…arms

Clears RUST/non-exhaustive-enum across aitesis, akouo-core, apotheke,
ergasia, exousia, horismos, kathodos, komide, kritike, paroche, prostheke,
syndesis, syntaxis, theatron-core, themelion, zetesis.

Each public enum gets #[non_exhaustive] for forward-compat semver
safety. Cross-crate match sites updated with appropriate wildcard
arms:

- kathodos::import::identify::resolve_media_type matches on the
  horismos::MediaType enum: added an unreachable!() arm noting a
  new variant without updated matcher is a programming error
- kathodos::scanner::watcher::detect_watcher_mode_at matches on the
  horismos::WatcherMode enum: same unreachable!() pattern

Within-crate matches unchanged — #[non_exhaustive] only forces wildcards
across crate boundaries.

Part of the harmonia 77-warning cleanup arc unblocking 05e cutover.
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Large PR detected — 39 files, 58 lines changed.

Consider splitting into smaller PRs for easier review. Not a blocker, just a signal.

@forkwright forkwright merged commit 1384523 into main Apr 20, 2026
2 of 3 checks passed
@forkwright forkwright deleted the fix/lint-non-exhaustive-enums branch April 20, 2026 12:57
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