Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis update revises and enhances documentation across multiple files. It corrects repository naming in contribution instructions, streamlines the README, updates configuration and validator documentation for clarity and accuracy, introduces a new console command usage guide, and adjusts configuration key naming conventions for consistency. Changes
Sequence Diagram(s)Not applicable: All changes are documentation-only and do not alter or introduce control flow. Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (6)
README.md (1)
42-42: Relative link works, but consider forward-compatibility.
docs/console-command.mdis correct today, yet if the README is ever rendered inside thedocsfolder (e.g. a docs site generator), the link will break. Using an absolute GitHub URL or./docs/console-command.mdavoids that edge case.docs/console-command.md (1)
13-14: Minor grammar / punctuation.Missing period at the end of the description and “sub-directories” could be clearer.
-| `--recursive` | `-r` | Search for translation files recursively in subdirectories +| `--recursive` | `-r` | Searches for translation files recursively in sub-directories. |docs/validators.md (4)
228-230: Remove duplicated heading text.
HtmlTagValidatoris repeated in the heading (## [...]HtmlTagValidator).
It renders oddly and breaks anchor generation in most Markdown engines.-## [`HtmlTagValidator`](../src/Validator/HtmlTagValidator.php)HtmlTagValidator +## [`HtmlTagValidator`](../src/Validator/HtmlTagValidator.php)
158-160: Grammar: “a whitespace” not “an whitespace”.- - Warning the translation key `contact` has an whitespace only value + - Warning the translation key `contact` has a whitespace-only value
285-287: Minor wording tweak for subject–verb agreement.-If not configured, it try to detect the most common pattern … +If not configured, it tries to detect the most common pattern …
340-350: YAML example overridescustom_patternthree times.YAML only keeps the last key, so earlier regex examples are silently discarded. Use a list instead to avoid misleading readers:
validator-settings: KeyNamingConventionValidator: custom_pattern: - '/^[a-z0-9]+$/' - '/^app\.[a-z][a-z0-9_]*$/' - '/^[a-z][a-z0-9_]{0,29}$/' # Max 30 characters
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
CONTRIBUTING.md(1 hunks)README.md(2 hunks)docs/config-file.md(5 hunks)docs/console-command.md(1 hunks)docs/file-detector.md(1 hunks)docs/validators.md(17 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
docs/config-file.md (2)
src/Validator/XliffSchemaValidator.php (1)
XliffSchemaValidator(33-106)tests/src/Validator/SchemaValidatorTest.php (3)
SchemaValidatorTest(32-393)testProcessFileWithValidXliff(100-112)testProcessFileWithInvalidXliff(114-126)
🪛 LanguageTool
docs/validators.md
[style] ~541-~541: Using many exclamation marks might seem excessive (in this case: 11 exclamation marks for a text that’s 5994 characters long)
Context: ...with schema violations.
(EN_EXCESSIVE_EXCLAMATION)
🔇 Additional comments (2)
CONTRIBUTING.md (1)
14-16: Repository URL & directory name look correct – no further action needed.The corrected clone URL and directory name now match the actual repository. Nice catch!
docs/config-file.md (1)
59-60: Class reference rename is consistent – good update.All JSON/YAML examples now reference
XliffSchemaValidator, matching the actual class name.
No issues spotted.Also applies to: 68-69
| file-detectors: | ||
| - "MoveElevator\\ComposerTranslationValidator\\FileDetector\\DirectoryFileDetector" | ||
| - "MoveElevator\\ComposerTranslationValidator\\FileDetector\\SuffixFileDetector" | ||
| ``` |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify implementation supports new file-detectors key (hyphen) before publishing docs.
The docs switch from file_detectors ➜ file-detectors.
If the PHP config loader still expects the underscore variant, users’ configs will break silently.
Update the loader to accept both forms or add a deprecation note.
Also applies to: 251-254
🏁 Script executed:
# Suggested quick sanity-check
rg --ignore-case --pretty "file_detectors" src | headLength of output: 53
To get a clearer picture of how the config loader handles the file-detectors key, let’s search for any references to both the hyphenated and underscored variants, plus how the plugin reads its config:
🏁 Script executed:
#!/bin/bash
echo "🔍 Searching for any ‘file_detectors’ usage across the repo"
rg -n "file_detectors"
echo "🔍 Searching for any ‘file-detectors’ usage across the repo"
rg -n "file-detectors"
echo "🔍 Inspecting how the plugin reads its extra config"
rg -n "getExtra" -C2 src
echo "🔍 Locating the PluginInterface implementation"
rg -n "PluginInterface" -C2 src
echo "🔍 Checking for Symfony Config TreeBuilder usage"
rg -n "TreeBuilder" -C2 src
echo "🔍 Looking specifically for arrayNode definitions of file detectors"
rg -n "arrayNode('file-detectors')" -C2 src
rg -n "arrayNode('file_detectors')" -C2 srcLength of output: 3174
Config loader only recognizes file-detectors (hyphen)
The codebase currently only supports the hyphenated key, so any existing configs using file_detectors (underscore) will break silently. Please choose one of the following:
-
Alias the old key
• In src/Config/ConfigValidator.php (around lines 43–44) acceptfile_detectorsas a fallback tofile-detectors
• In src/Config/ConfigFactory.php (around line 63) map both variants tosetFileDetectors()
• Update schema/translation-validator.schema.json (around line 31) to recognizefile_detectors(with a deprecation message)
• Add tests in tests/src/Fixtures/config and ConfigFactoryTest/ConfigValidatorTest to cover the underscore variant -
Document a breaking change
• In docs/upgrade.md or the changelog, note removal offile_detectorsin favor offile-detectors
• Throw a clear exception in ConfigValidator iffile_detectorsis used, guiding users to the new key
Affected files to update:
- src/Config/ConfigValidator.php
- src/Config/ConfigFactory.php
- schema/translation-validator.schema.json
- tests/src/Fixtures/config/…
- docs/file-detector.md (243–246, 251–254)
- docs/config-file.md (61, 97)
🤖 Prompt for AI Agents
In docs/file-detector.md around lines 243 to 246, the config example uses the
hyphenated key `file-detectors` which is the only supported key currently. To
fix the silent breakage for configs using the underscore variant
`file_detectors`, either implement an alias fallback in
src/Config/ConfigValidator.php (lines 43-44) and src/Config/ConfigFactory.php
(around line 63) to accept both keys, update the JSON schema
(translation-validator.schema.json around line 31) to recognize `file_detectors`
with a deprecation warning, and add tests for the underscore variant; or
alternatively document the breaking change in docs/upgrade.md or changelog and
throw a clear exception in ConfigValidator if `file_detectors` is used. Also
update related docs at docs/file-detector.md (lines 243-246 and 251-254) and
docs/config-file.md (lines 61 and 97) accordingly.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
docs/validators.md (1)
126-128: Malformed fenced-code block still breaks renderingThe closing delimiter has four back-ticks instead of three, so everything afterwards is rendered as code. Same issue was raised previously.
-```bash -composer validate-translations ./translations --skip "MoveElevator\\ComposerTranslationValidator\\Validator\\DuplicateValuesValidator" -```` +```bash +composer validate-translations ./translations --skip "MoveElevator\\ComposerTranslationValidator\\Validator\\DuplicateValuesValidator" +```
🧹 Nitpick comments (2)
docs/validators.md (2)
321-324: Incorrect heading & missing fenced-code language
### #Console Outputhas an extra#.- The following code block lacks a language tag, triggering MD040.
-### #Console Output -``` +#### Console Output +```text
298-300: Minor grammar fix – “it try” → “it tries”.-If not configured, it try to detect the most common pattern used in your files and warns about inconsistencies. +If not configured, it tries to detect the most common pattern used in your files and warns about inconsistencies.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/validators.md(15 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
docs/validators.md
9-9: Link fragments should be valid
(MD051, link-fragments)
214-214: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
322-322: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
528-528: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🪛 LanguageTool
docs/validators.md
[style] ~554-~554: Using many exclamation marks might seem excessive (in this case: 12 exclamation marks for a text that’s 6722 characters long)
Context: ...with schema violations.
(EN_EXCESSIVE_EXCLAMATION)
…ing enhancements and additional examples
…nclude key naming convention warnings
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (2)
docs/file-detector.md (2)
241-246: Reminder: config key rename may still be a breaking changeThe docs exclusively use
file-detectors:(hyphen). Unless the PHP config loader now aliases the formerfile_detectorskey, existing user configs will break silently – this was already raised in a previous review.Please either:
- add backward-compatibility in the loader (
file_detectors➜file-detectors), or- highlight this as a breaking change in the upgrade guide and throw a clear exception if the old key is encountered.
251-254: Same concern for JSON snippetSame as above – ensure code supports both keys or document the breaking change.
🧹 Nitpick comments (3)
docs/validators.md (3)
15-18: Grammar & redundancy in IMPORTANT call-out“Others validators return just return a warning” – duplicated verb and wrong plural.
- -  Others validators return just return a warning. Therefore, just a warning indicates that the validation succeeded, but there are potential issues that should be addressed. + -  Other validators only return a warning. A warning indicates that the validation succeeded, but there are potential issues that should be addressed.
213-218: Add language hint to console output blocks (MD040)Markdown-lint flags these fenced blocks because no language is specified.
Usetext(orconsole) to silence the warning and improve rendering.-``` +```textRepeat for similar blocks below.
533-540: Missing language spec on fenced block (MD040)Add
textto the opening backticks of this console output to satisfy linter and provide syntax highlighting.-``` +```text
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
README.md(2 hunks)docs/file-detector.md(7 hunks)docs/validator-configuration.md(0 hunks)docs/validators.md(15 hunks)
💤 Files with no reviewable changes (1)
- docs/validator-configuration.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md
19-19: Link fragments should be valid
(MD051, link-fragments)
docs/validators.md
214-214: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
322-322: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
535-535: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🪛 LanguageTool
docs/validators.md
[style] ~561-~561: Using many exclamation marks might seem excessive (in this case: 12 exclamation marks for a text that’s 6713 characters long)
Context: ...with schema violations.
(EN_EXCESSIVE_EXCLAMATION)
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
docs/validators.md (3)
50-59: Add a language identifier to console-output blocks
markdownlintflags these fences (MD040). Addingbashorconsoleavoids the warning and enables syntax highlighting.Example fix:
-``` +```bash # console output …Do this for all four blocks highlighted above. Also applies to: 214-222, 321-331, 535-545 --- `299-300`: **Minor grammar tweak** — “it tries” ```diff -If not configured, it try to detect the most common pattern +If not configured, it tries to detect the most common pattern
173-174: Article & hyphenation- - Warning the translation key `contact` has an whitespace only value + - Warning the translation key `contact` has a whitespace-only value
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
README.md(2 hunks)docs/console-command.md(1 hunks)docs/validators.md(15 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- docs/console-command.md
- README.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
docs/validators.md
214-214: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
322-322: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
535-535: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🪛 LanguageTool
docs/validators.md
[style] ~561-~561: Using many exclamation marks might seem excessive (in this case: 12 exclamation marks for a text that’s 6712 characters long)
Context: ...with schema violations.
(EN_EXCESSIVE_EXCLAMATION)
Summary by CodeRabbit