Skip to content

✨ feat: Add optional description field to rules#4

Merged
heumsi merged 5 commits intomainfrom
feat/rule-description
Mar 31, 2026
Merged

✨ feat: Add optional description field to rules#4
heumsi merged 5 commits intomainfrom
feat/rule-description

Conversation

@heumsi
Copy link
Copy Markdown
Owner

@heumsi heumsi commented Mar 31, 2026

Summary

  • Add optional description field to the Rule dataclass for human-readable rule explanations
  • Update violation output format to always use a two-line structure: [rule_name] (with optional description) on the first line, name (message) on the second line
  • Update all docs output examples to match the new format

Output format

# With description
src/domain/service.py:4
    [bool-method-prefix] Bool-returning functions must use a semantic prefix
    validate (expected prefix: is_ | has_ | should_)

# Without description
src/domain/service.py:4
    [bool-method-prefix]
    validate (expected prefix: is_ | has_ | should_)

Test plan

  • All 92 existing tests pass
  • New tests for reporter with/without description
  • New test for config parsing with description field

🤖 Generated with Claude Code

heumsi and others added 5 commits April 1, 2026 00:52
Add an optional `description` field to the Rule dataclass that allows
users to provide a human-readable explanation for each rule. When set,
the description is displayed in violation output above the violation
detail line.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only keep quotes where special characters (<, >) require them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 910f7cf into main Mar 31, 2026
5 checks passed
@heumsi heumsi deleted the feat/rule-description branch March 31, 2026 16:06
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