Repository navigation
build: warn on unread control-store state and unconstructed enum variants - #1306
Merged
Merged
Conversation
…ants Two custom fensu rules in warn mode on the Rust target: - XSB076 reports control-store tables and columns created in the store SQL that no production SQL reads; writes, indexes and tests do not count. - XSB077 reports Rust enum variants, pub included, that production code never constructs or matches.
…t output fensu 0.28.0 sends complete file fact dependencies back from the Rust custom-rule host, which overflows its 16 MiB capture once a project rule reads every file, as XSB077 does under fensu check --warn.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A simplicity audit of the scheduler stack found state written but never read and enum variants never produced; rustc misses pub items and nothing flags write-only SQL columns. These rules surface both, in warn mode first.
Changes
control-store-unread-state: tables and columns created byCREATE TABLE/ALTER TABLE ... ADD COLUMNunder the configured store directory that no production SQL reads (SQL files or Rust string literals outside tests). Writes,excluded.upsert values,DELETEtargets, indexes and comments do not count.unconstructed-enum-variant: Rust enum variants, pub included, that no production code names by path,Self::in an impl, or a glob/brace import. Macro-declared enums and#[from]variants are skipped.warnon the Rust target, sofensu checkstays green andfensu check --warnreports them.Verification
fensu check --warn: main 0 faults, 31 XSB077 warnings (wire enums built by serde, plus two config error kinds); the pre-simplification scheduler baseline 50 XSB076 and 38 XSB077.fensu check,fensu dupes --since origin/main(0 clusters) andmake check-ciclean.