Skip to content

✨ feat: Add inline ignore comments support (# pnl: ignore)#2

Merged
heumsi merged 1 commit intomainfrom
feat/inline-ignore-comment
Mar 31, 2026
Merged

✨ feat: Add inline ignore comments support (# pnl: ignore)#2
heumsi merged 1 commit intomainfrom
feat/inline-ignore-comment

Conversation

@heumsi
Copy link
Copy Markdown
Owner

@heumsi heumsi commented Mar 31, 2026

Summary

  • Add support for inline ignore comments to suppress lint violations on specific lines
  • # pnl: ignore — suppress all rules on the line
  • # pnl: ignore=rule-name — suppress a specific rule
  • # pnl: ignore=rule-a,rule-b — suppress multiple rules (comma-separated)

Changes

  • python_naming_linter/ignore.py: New module with parse_ignore_comments() and filter_violations()
  • python_naming_linter/cli.py: Integrate ignore comment parsing and violation filtering
  • tests/test_ignore.py: 14 tests covering parsing and filtering logic

Test plan

  • Parse # pnl: ignore (all rules)
  • Parse # pnl: ignore=rule-name (specific rule)
  • Parse # pnl: ignore=rule-a,rule-b (multiple rules)
  • Variations: no space after #, extra spaces
  • Filter violations correctly based on parsed ignores
  • All 89 tests pass
  • Lint and format checks pass

🤖 Generated with Claude Code

Support suppressing lint violations on specific lines using inline
comments:
- `# pnl: ignore` suppresses all rules on the line
- `# pnl: ignore=rule-name` suppresses a specific rule
- `# pnl: ignore=rule-a,rule-b` suppresses multiple rules

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