refactor(parser): split lint.rs into lint/ module directory#46
Merged
Conversation
Modularize the 4991-line lint.rs into focused submodules for
maintainability. No logic, behavior, or API changes -- pure
restructuring with identical test results (241 tests pass).
New structure:
lint/
mod.rs -- public types, helpers, public API, config/suppression
rules/
mod.rs -- submodule declarations
metadata.rs -- shared metadata checks (title, id, status, dates, etc.)
detection.rs -- detection rule checks, logsource, modifier compatibility
correlation.rs -- correlation rule checks, timespan validation
filter.rs -- filter rule checks
shared.rs -- unknown key detection, known-key constants
Roadmap item #14 (Large File Modularization), step 1/13.
Make is_valid_uuid pub(crate) in metadata.rs and import it from detection.rs instead of maintaining an identical inline copy.
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
crates/rsigma-parser/src/lint.rs(4991 lines) into alint/module directory with 7 files for better maintainabilitylint/rules/subdirectory groups rule checks by category: metadata, detection, correlation, filter, shared (unknown keys)Test plan
cargo fmt --all -- --checkpassescargo clippy --workspace --all-targets --all-features -- -D warningspasses (zero warnings)cargo test -p rsigma-parserpasses (241 tests, 0 failures)cargo check -p rsigma-lsppasses (downstream consumer of lint types)