Update package name & refactor code style configuration#275
Conversation
- Renamed package from `gomzyakov/php-cs-fixer-config` to `gomzyakov/code-style`. - Updated class names and namespaces in the configuration files to reflect the new package structure. - Added new classes: `CodeStyleConfig`, `CodeStyleFinder`, and `CodeStyleRules` for better organization and functionality. - Modified README.md to reflect the new package name and usage instructions. - Updated composer.json scripts and autoloading to align with the new structure.
- Changed job name from "Test & Upload coverage.xml to Codecov" to "Run tests". - Removed coverage generation and Codecov upload steps for a more streamlined testing process. - Retained the step to run PHPUnit tests and display the coverage.xml file.
|
Caution Review failedThe pull request is closed. WalkthroughThe PR renames the package from gomzyakov/php-cs-fixer-config to gomzyakov/code-style, updates composer metadata (name, homepage, PSR-4 mapping from Gomzyakov\CS\ to Gomzyakov) and renames the composer script (cs-fix → fix). Public classes/namespaces moved from Gomzyakov\CS to Gomzyakov and renamed: Config → CodeStyleConfig, Finder → CodeStyleFinder, Rules → CodeStyleRules. .php-cs-fixer.dist.php and tests updated to use the new class names and factories. CodeStyleConfig now sets a parallel config via ParallelConfigFactory::detect() and sources rules from CodeStyleRules. README badges/URLs updated. CI workflow simplified to run phpunit without coverage/Codecov steps. Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
composer.json (1)
39-39: Consider backward compatibility for script rename.Renaming the script from
cs-fixtofixwill break existing CI/CD pipelines and developer workflows that referencecomposer cs-fix.For better backward compatibility, consider keeping both scripts:
"scripts": { "fix": "@php ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php", + "cs-fix": "@fix", "cs-check": "@php ./vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run",This allows a gradual migration path for users while maintaining backward compatibility.
README.md (1)
1-80: Consider adding migration guidance for existing users.While the documentation is thorough for new users, existing users of
gomzyakov/php-cs-fixer-configwould benefit from a migration guide. Consider adding a section that documents:
- The package name change
- The namespace change (from
Gomzyakov\CS\toGomzyakov\)- The class renames (e.g.,
Config→CodeStyleConfig)- The script rename (
cs-fix→fix)- Required steps to migrate existing installations
This could be added as a new section in the README or as a separate MIGRATION.md file.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
.php-cs-fixer.dist.php(1 hunks)README.md(4 hunks)composer.json(4 hunks)src/CodeStyleConfig.php(2 hunks)src/CodeStyleFinder.php(1 hunks)src/CodeStyleRules.php(2 hunks)tests/CodeStyleConfigTest.php(1 hunks)tests/CodeStyleFinderTest.php(1 hunks)tests/CodeStyleRulesTest.php(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (5)
tests/CodeStyleRulesTest.php (1)
src/CodeStyleRules.php (2)
CodeStyleRules(15-33)getRules(22-32)
.php-cs-fixer.dist.php (2)
src/CodeStyleFinder.php (2)
CodeStyleFinder(9-27)createWithRoutes(18-26)src/CodeStyleConfig.php (2)
CodeStyleConfig(11-29)createWithFinder(21-28)
tests/CodeStyleConfigTest.php (1)
src/CodeStyleConfig.php (2)
CodeStyleConfig(11-29)createWithFinder(21-28)
src/CodeStyleConfig.php (1)
src/CodeStyleRules.php (2)
CodeStyleRules(15-33)getRules(22-32)
tests/CodeStyleFinderTest.php (1)
src/CodeStyleFinder.php (2)
CodeStyleFinder(9-27)createWithRoutes(18-26)
🔇 Additional comments (5)
.php-cs-fixer.dist.php (2)
5-6: LGTM! Class imports updated correctly.The imports reflect the new namespace structure (
Gomzyakov) and class names (CodeStyleFinder,CodeStyleConfig) as intended by this refactoring.
11-11: LGTM! Usage updated to match new API.The method calls correctly use the renamed classes and are consistent with the method signatures shown in the source files.
README.md (3)
3-6: LGTM! Badges updated to reflect new package.All badge URLs correctly reference the new package name
gomzyakov/code-styleand repository structure.
17-17: LGTM! Installation and usage examples updated.The installation command and code examples correctly reference the new package name and class names (
CodeStyleFinder,CodeStyleConfig).Also applies to: 27-28, 33-33
54-67: LGTM! Configuration examples updated consistently.All documentation examples correctly use the renamed classes and methods throughout.
…parallel configuration - Updated various dependencies in composer.lock, including phpunit, phpstan, and symfony packages, to their latest versions. - Added parallel configuration support in CodeStyleConfig to enhance performance during code style checks.
- Modified the job name to include the PHP version being used. - Implemented a matrix strategy to run tests on PHP versions 8.3 and 8.4. - Simplified the PHP setup step to dynamically use the specified PHP version from the matrix.
gomzyakov/php-cs-fixer-configtogomzyakov/code-style.CodeStyleConfig,CodeStyleFinder, andCodeStyleRulesfor better organization and functionality.