Skip to content

✨ feat: Add inline ignore comment support#22

Merged
heumsi merged 2 commits intomainfrom
feat/inline-ignore-comment
Mar 31, 2026
Merged

✨ feat: Add inline ignore comment support#22
heumsi merged 2 commits intomainfrom
feat/inline-ignore-comment

Conversation

@heumsi
Copy link
Copy Markdown
Owner

@heumsi heumsi commented Mar 31, 2026

Summary

  • Add # pdl: ignore inline comment to suppress all lint violations on an import line
  • Add # pdl: ignore[rule-name] to suppress a specific rule only
  • Add # pdl: ignore[rule1, rule2] to suppress multiple rules by comma-separated names

Changes

  • parser.py: Add _parse_ignore_comment() function and ignore_rules field to ImportInfo
  • cli.py: Filter out violations matching ignore rules after violation detection
  • Add 6 parser unit tests and 4 E2E CLI tests

Test plan

  • Parse ignore comments (blanket, single rule, multiple rules, whitespace variants)
  • parse_imports populates ignore_rules field correctly
  • E2E: blanket ignore suppresses all violations on the line
  • E2E: specific rule name suppresses only that rule
  • E2E: non-matching rule name does not suppress violations
  • E2E: multiple rule names suppress all listed rules
  • All 92 existing + new tests pass

🤖 Generated with Claude Code

heumsi and others added 2 commits March 31, 2026 12:05
Add `# pdl: ignore` syntax to suppress lint violations on specific
import lines. Supports blanket ignore (`# pdl: ignore`) and selective
ignore by rule name (`# pdl: ignore[rule1, rule2]`).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@heumsi heumsi merged commit 44333b9 into main Mar 31, 2026
5 checks passed
@heumsi heumsi deleted the feat/inline-ignore-comment branch March 31, 2026 03:10
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