Skip to content

fix: resolve minor best-practice items (#334)#344

Merged
ajianaz merged 1 commit into
developfrom
fix/p3-minor-best-practice
Jul 16, 2026
Merged

fix: resolve minor best-practice items (#334)#344
ajianaz merged 1 commit into
developfrom
fix/p3-minor-best-practice

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Resolves the remaining minor best-practice items tracked under #334 so the issue can be fully closed. The P3-core items (#94, #81, #57, #58, #80) were already done in PR #342; this PR cleans up the 12 minor nits (8 implemented, 2 verified already-done, 2 noted).

Implemented fixes

# File Fix
#87 security_scanner.rs is_test_file uses path-segment awareness — latest, aspect, attestation, protest no longer mistaken for test files
#66 rules/matching.rs Directory excludes (src/) match only at segment boundaries (mysrc/, docs/src-guide/ no longer caught)
#68 context/types.rs estimate_tokens returns ≥1 for non-empty content (was 0 under integer division)
#72 context/extraction.rs Java import regex keeps the wildcard (import com.example.*) + supports import static
#73 context/extraction.rs Rust mod foo; extracted as a dependency symbol (matches documented behavior)
#23 index/mod.rs index_stats queries PRAGMA page_size instead of assuming 4096 bytes
#48 engine/types.rs issue_type serializes as issue_type (consistent); type kept as deserialize alias
#10 engine/types.rs Severity::from_str_lossy uses eq_ignore_ascii_case (no allocation)

Verified already-resolved (no change)

Notes

Testing

  • 8 new tests covering each behavioral change.
  • All 652 tests pass (630 unit + 16 CLI + 6 config).
  • Clippy clean, fmt clean, cargo audit clean.

Closes #334

Closes the remaining minor items tracked under #334 so the issue can be
fully resolved. Each fix is small and targeted.

- #87 is_test_file: path-segment awareness so `latest`, `aspect`,
  `attestation`, `protest` are not mistaken for test files.
- #66 glob_matches: directory excludes (`src/`) match only at segment
  boundaries (`mysrc/`, `docs/src-guide/` no longer caught).
- #68 estimate_tokens: non-empty content returns at least 1 token (was 0
  under integer division).
- #72 RE_JAVA_IMPORT: allow wildcard capture (`import com.example.*` keeps
  the `*`), plus `import static`.
- #73 RE_RUST_MOD: extract `mod foo;` declarations as dependency symbols,
  matching the documented behavior.
- #23 index_stats: query `PRAGMA page_size` instead of assuming 4096 bytes.
- #48 ReviewIssue.issue_type: serialize as `issue_type` (consistent with
  the field name); keep `type` as a deserialize alias.
- #10 Severity::from_str_lossy: use `eq_ignore_ascii_case` (no allocation).

Already-resolved items verified (no change needed):
- #88 max_findings cutoff already sorts severity-descending before truncate.
- #30 debt snapshot save already emits a warn! on write failure.

8 new tests. All 652 tests pass; clippy + fmt + audit clean.

Closes #334
@ajianaz
ajianaz merged commit bc74716 into develop Jul 16, 2026
10 checks passed
@ajianaz
ajianaz deleted the fix/p3-minor-best-practice branch July 16, 2026 02:53
@ajianaz ajianaz mentioned this pull request Jul 16, 2026
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.

P3: Add config validation and best practice fixes

1 participant