Skip to content

refactor(parser): split lint.rs into lint/ module directory#46

Merged
mostafa merged 2 commits into
mainfrom
feat/modularize-lint
Apr 30, 2026
Merged

refactor(parser): split lint.rs into lint/ module directory#46
mostafa merged 2 commits into
mainfrom
feat/modularize-lint

Conversation

@mostafa
Copy link
Copy Markdown
Member

@mostafa mostafa commented Apr 30, 2026

Summary

  • Split crates/rsigma-parser/src/lint.rs (4991 lines) into a lint/ module directory with 7 files for better maintainability
  • No functionality changes: pure restructuring with identical test results (241 tests pass, full workspace clippy clean)
  • New lint/rules/ subdirectory groups rule checks by category: metadata, detection, correlation, filter, shared (unknown keys)

Test plan

  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets --all-features -- -D warnings passes (zero warnings)
  • cargo test -p rsigma-parser passes (241 tests, 0 failures)
  • cargo check -p rsigma-lsp passes (downstream consumer of lint types)
  • Doc-tests pass (including the lint module example)

mostafa added 2 commits April 30, 2026 15:16
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.
@mostafa mostafa merged commit 44882d4 into main Apr 30, 2026
8 checks passed
@mostafa mostafa deleted the feat/modularize-lint branch April 30, 2026 13:34
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