Problem Summary
When users place custom configuration files for tools (e.g., rector.php, phpstan.neon) in their project root or config directory, the custom files should replace the default configurations provided by quality-tools. However, this functionality has multiple validation and execution issues due to schema validation conflicts in the configuration discovery process.
Steps to Reproduce
Prerequisites
- Quality-tools package installed in a TYPO3 project
- Access to project root directory
Test Case 1: Basic Configuration File Override
-
Create a custom rector configuration in project root:
cat > rector.php << 'EOF'
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths(['custom-path/']);
};
EOF
-
Test configuration validation:
vendor/bin/qt config:validate
-
Test configuration display:
vendor/bin/qt config:show
-
Test rector execution:
vendor/bin/qt lint:rector --dry-run
Test Case 2: Config Directory Override
-
Create configuration in config directory:
mkdir -p config
cat > config/rector.php << 'EOF'
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths(['config-custom-path/']);
};
EOF
-
Repeat validation and execution tests from Test Case 1
Expected Behavior
- Configuration Validation: Should properly validate merged configurations that include custom tool config file metadata
- Tool Execution: Tools should use custom configuration files when present, falling back to defaults when not
- Configuration Display: Should show merged configuration including custom tool config paths without schema errors
- Priority Handling: Custom configs should override defaults with clear precedence rules
Observed Behavior
qt config:validate reports "[OK] Configuration is valid" (false positive)
qt lint:rector ignores the custom config file and uses the default config
qt config:show fails with schema validation errors:
[ERROR] Failed to load configuration:
Configuration file error [merged]: Invalid merged configuration:
: The property tool_config_file is not defined and the definition does not allow additional properties
: The property custom_config is not defined and the definition does not allow additional properties
Root Cause
The system discovers custom tool configs but adds runtime metadata keys (tool_config_file, custom_config) that aren't defined in the JSON schema at config/schema/quality-tools.json, causing validation failures when the merged configuration is validated.
Solution Branch
Work on this issue is being tracked in the issue-022-configuration-file-replacement-fix branch.
Detailed Analysis
For comprehensive technical analysis, implementation plan, and solution approach, see: Issue 022 Documentation
Impact
Priority: High - Core functionality broken
User Impact:
- Users cannot override default tool configurations
- False positive validation results create confusion
- Configuration introspection commands fail
- Reduced flexibility in tool customization
Problem Summary
When users place custom configuration files for tools (e.g.,
rector.php,phpstan.neon) in their project root or config directory, the custom files should replace the default configurations provided by quality-tools. However, this functionality has multiple validation and execution issues due to schema validation conflicts in the configuration discovery process.Steps to Reproduce
Prerequisites
Test Case 1: Basic Configuration File Override
Create a custom rector configuration in project root:
Test configuration validation:
Test configuration display:
Test rector execution:
Test Case 2: Config Directory Override
Create configuration in config directory:
Repeat validation and execution tests from Test Case 1
Expected Behavior
Observed Behavior
qt config:validatereports "[OK] Configuration is valid" (false positive)qt lint:rectorignores the custom config file and uses the default configqt config:showfails with schema validation errors:Root Cause
The system discovers custom tool configs but adds runtime metadata keys (
tool_config_file,custom_config) that aren't defined in the JSON schema atconfig/schema/quality-tools.json, causing validation failures when the merged configuration is validated.Solution Branch
Work on this issue is being tracked in the
issue-022-configuration-file-replacement-fixbranch.Detailed Analysis
For comprehensive technical analysis, implementation plan, and solution approach, see: Issue 022 Documentation
Impact
Priority: High - Core functionality broken
User Impact: