refactor: move rule modules into src/rules/<group>/ - #56
Open
mgiovani wants to merge 1 commit into
Open
Conversation
Each of the 44 rule files moves into the subdirectory named after its groups.rs entry; imports_data.rs stays at the top level because it is a shared table, not a rule. Only fully-qualified paths change: every registry::RULES entry and every cross-rule import gains a <group> segment, and synonym_rotation's two super::fragmentation paths become crate::rules::rhetoric::fragmentation since super:: now names verbosity. RULES order, codes, messages, and group names are untouched; --list-rules and the dogfood run are byte-identical before and after. AGENTS.md gains the refactor/ branch prefix that pairs with the refactor: commit type it already lists.
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.
Summary
Pure mechanical refactor for #7: the 44 flat rule files move from
src/rules/<tell>.rsintosrc/rules/<group>/<tell>.rs, one subdirectory pergroups.rsentry (artifact/,structure/,stdlib/,rhetoric/,verbosity/,sourcing/,format/).imports_data.rsstays at the top level because it is a shared table, not a rule.Closes #7
Changes
git mv, so the diff shows renames. Each group gets amod.rsholding only alphabeticalpub modlines, andsrc/rules/mod.rsshrinks to the 7 group modules plusimports_data.registry::RULESentry and every cross-rule import gains a<group>segment.synonym_rotation's twosuper::fragmentationpaths becomecrate::rules::rhetoric::fragmentation, becausesuper::now namesverbosity.RULESorder, rule codes, messages, and group names are untouched.AGENTS.md: "Adding a rule" steps 1 and 2 point atsrc/rules/<group>/, and the branch-prefix list gainsrefactor/, pairing with therefactor:commit type it already allowed.CHANGELOG.md:### Changedentry under Unreleased.Library path note
lib.rsdeclarespub mod rules, sostopslop::rules::<module>is nowstopslop::rules::<group>::<module>. Nothing intests/,bench/, or the docs used the old paths, and thestopslop::imports_datare-export is unchanged. The changelog records it; the next release should be 0.6.0.Verification
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test: all green (896 unit tests, fixture and witness suites pass).groups_partition_every_ruleruns unchanged.stopslop . --list-rulesand the dogfood runstopslop .(stdout and exit code) captured onmainand on this branch: byte-identical.crate::rules::<module>without a group segment orsuper::fragmentation: no hits.