Schema Reference
This page documents all available configuration options for the Composer Translation Validator.
paths
- Type:
array<string> - Default:
[] - Description: Array of directory paths to scan for translation files
yaml
paths:
- translations/
- resources/lang/validators
- Type:
array<string> - Default:
[](uses all available validators) - Description: Array of validator class names to use for validation
yaml
validators:
- MoveElevator\ComposerTranslationValidator\Validator\MismatchValidator
- MoveElevator\ComposerTranslationValidator\Validator\DuplicateKeysValidatorfile-detectors
- Type:
array<string> - Default:
[](uses automatic detection) - Description: Array of file detector class names to use for file grouping
yaml
file-detectors:
- MoveElevator\ComposerTranslationValidator\FileDetector\SuffixFileDetectorAvailable detectors:
PrefixFileDetector- Groups files likeen.messages.xlfSuffixFileDetector- Groups files likemessages.en.yamlDirectoryFileDetector- Groups files likeen/messages.php
only
- Type:
array<string> - Default:
[] - Description: Array of validator class names to run exclusively (overrides
validators)
yaml
only:
- MoveElevator\ComposerTranslationValidator\Validator\MismatchValidatorskip
- Type:
array<string> - Default:
['DuplicateValuesValidator'] - Description: Array of validator class names to skip
yaml
skip:
- MoveElevator\ComposerTranslationValidator\Validator\HtmlTagValidatorexclude
- Type:
array<string> - Default:
[] - Description: Array of glob patterns for files/directories to exclude from validation
yaml
exclude:
- "**/backup/**"
- "**/cache/**"
- "**/*.bak"strict
- Type:
boolean - Default:
false - Description: Whether to treat warnings as errors
yaml
strict: truedry-run
- Type:
boolean - Default:
false - Description: Whether to run in dry-run mode (no errors thrown)
yaml
dry-run: trueformat
- Type:
string - Default:
cli - Options:
cli,json,github - Description: Output format for validation results
yaml
format: jsonverbose
- Type:
boolean - Default:
false - Description: Whether to enable verbose output
yaml
verbose: truevalidator-settings
- Type:
object - Default:
{} - Description: Per-validator configuration options
yaml
validator-settings:
KeyCountValidator:
threshold: 500
KeyDepthValidator:
threshold: 5
KeyNamingConventionValidator:
convention: snake_caseKeyCountValidator Settings
| Option | Type | Default | Description |
|---|---|---|---|
threshold | integer | 300 | Maximum number of keys before warning |
KeyDepthValidator Settings
| Option | Type | Default | Description |
|---|---|---|---|
threshold | integer | 8 | Maximum nesting depth before warning |
KeyNamingConventionValidator Settings
| Option | Type | Default | Description |
|---|---|---|---|
convention | string | auto-detect | Naming convention to enforce |
custom_pattern | string | - | Custom regex pattern |
Supported conventions:
snake_case-user_name,form_submitcamelCase-userName,formSubmitkebab-case-user-name,form-submitPascalCase-UserName,FormSubmit
Custom pattern examples:
yaml
validator-settings:
KeyNamingConventionValidator:
# Only lowercase letters and numbers
custom_pattern: '/^[a-z0-9]+$/'
# Specific prefix requirement
custom_pattern: '/^app\.[a-z][a-z0-9_]*$/'
# Maximum length constraint
custom_pattern: '/^[a-z][a-z0-9_]{0,29}$/'