feat: add --exclude option to validate-translations command#79
feat: add --exclude option to validate-translations command#79konradmichalik merged 3 commits intomainfrom
Conversation
WalkthroughAdded a new CLI option Changes
Sequence Diagram(s)sequenceDiagram
participant User as User (CLI)
participant Cmd as ValidateTranslationCommand
participant Conf as Config (excludes)
participant Detector as FileDetector
User->>Cmd: invoke validate-translations --exclude "pattern1,pattern2" --dry-run
Cmd->>Conf: read configured excludes
Cmd->>Cmd: parse CLI comma-separated excludes
Cmd->>Conf: merge CLI excludes with configured excludes
Cmd->>Detector: detect files (apply merged excludes)
Detector-->>Cmd: file list
Cmd-->>User: validation output (status)
note right of Cmd #DDEBF7: New/changed interaction: CLI parsing & merge of excludes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/src/Command/ValidateTranslationCommandTest.php (1)
313-368: Consider verifying actual file exclusion behavior.The tests confirm the command accepts the
--excludeoption without errors, but they don't verify that files matching the patterns are actually excluded from validation. The patterns used (**/nonexistent/**,**/backup/**,**/temp/**) don't match any files in the test fixtures.Consider adding a test that:
- Uses a fixture directory with files that should be excluded
- Passes a pattern that matches those files
- Verifies the excluded files don't appear in validation results or output
This would provide stronger confidence that the exclusion logic works correctly end-to-end.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docs/console-command.md(2 hunks)src/Command/ValidateTranslationCommand.php(3 hunks)tests/src/Command/ValidateTranslationCommandTest.php(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
tests/src/Command/ValidateTranslationCommandTest.php (1)
src/Command/ValidateTranslationCommand.php (2)
ValidateTranslationCommand(37-275)execute(169-245)
src/Command/ValidateTranslationCommand.php (1)
src/Config/TranslationValidatorConfig.php (1)
getExclude(216-219)
🔇 Additional comments (3)
docs/console-command.md (1)
4-4: LGTM!The documentation is clear, consistent with other options, and accurately reflects the implementation.
Also applies to: 14-14
src/Command/ValidateTranslationCommand.php (2)
102-107: LGTM!The option configuration and help text are well-structured and provide clear guidance to users.
Also applies to: 123-123
179-186: Implementation looks solid.The merge logic correctly combines configuration-based exclude patterns with CLI-provided patterns. The approach is straightforward and maintainable.
Summary by CodeRabbit
New Features
Documentation
Tests