Skip to content

fix(static): prevent patterns crossing paragraph boundaries - #491

Open
atirna wants to merge 2 commits into
NVIDIA:mainfrom
atirna:fix/static-paragraph-boundaries
Open

fix(static): prevent patterns crossing paragraph boundaries#491
atirna wants to merge 2 commits into
NVIDIA:mainfrom
atirna:fix/static-paragraph-boundaries

Conversation

@atirna

@atirna atirna commented Sep 6, 2026

Copy link
Copy Markdown

Why

Static regex patterns using \s+ or \s* could combine text from separate paragraphs. EA1 therefore matched enable\n\nAny tools even though those phrases were unrelated.

Summary

  • Bound shared static-pattern matching at blank paragraph boundaries.
  • Kept soft-wrapped same-paragraph matches and P9 whitespace-padding detection unchanged.

Fixes #446

Verification

  • uv run make lint
  • uv run make format-check
  • uv run --extra dev pytest tests/nodes/analyzers/test_static_runner_filtering.py -k 'blank_line_breaks_static_pattern_match or soft_wrapped_static_pattern_match'
  • uv run --extra dev pytest tests/nodes/analyzers/test_static_patterns.py::TestRunStaticPatternsP9WhitespacePadding::test_vertical_gap_then_instruction_high_severity

Signed-off-by: Atirna <288419661+atirna@users.noreply.github.com>
Signed-off-by: Atirna <288419661+atirna@users.noreply.github.com>
@atirna
atirna force-pushed the fix/static-paragraph-boundaries branch from d49d9ff to 63bc86a Compare September 6, 2026 23:24
@atirna

atirna commented Sep 6, 2026

Copy link
Copy Markdown
Author

pushed the required DCO sign-off to the follow-up commit. Source diff is unchanged.

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.

Static patterns: \s+/\s* cross paragraph boundaries — 1,485 occurrences across all 15 pattern files (systemic #405)

1 participant