Skip to content

✨ feat: Allow dot (.) in rule names#5

Merged
heumsi merged 3 commits intomainfrom
feat/allow-dot-in-rule-name
Mar 31, 2026
Merged

✨ feat: Allow dot (.) in rule names#5
heumsi merged 3 commits intomainfrom
feat/allow-dot-in-rule-name

Conversation

@heumsi
Copy link
Copy Markdown
Owner

@heumsi heumsi commented Mar 31, 2026

Summary

  • Allow . (dot) character in rule names, enabling module-path-style naming like shared.domain or context.adapters.inbound
  • Update rule name validation regex from [a-zA-Z0-9_-]+ to [a-zA-Z0-9_.-]+
  • Update inline ignore comment regex to also accept dots in rule names

Motivation

Inspired by heumsi/python-dependency-linter#27. Dots create a visual correspondence between rule names and their target module paths:

- name: shared.domain
  modules: src.shared.domain

Changes

  • config.py: Updated _VALID_RULE_NAME_RE and error message to allow dots
  • ignore.py: Updated _IGNORE_RE to allow dots in rule names within ignore comments
  • test_config.py: Moved rule.name from invalid to valid cases, added shared.domain test
  • test_ignore.py: Added tests for ignore comments with dotted rule names

Test plan

  • All existing tests pass
  • New valid rule name cases (rule.name, shared.domain) accepted
  • Invalid rule names still rejected
  • Inline ignore comments work with dotted rule names

🤖 Generated with Claude Code

heumsi and others added 3 commits April 1, 2026 02:01
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 abe4e39 into main Mar 31, 2026
5 checks passed
@heumsi heumsi deleted the feat/allow-dot-in-rule-name branch March 31, 2026 17: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