Releases: easy-coding-standard/easy-coding-standard
Released: EasyCodingStandard 12.5.5
What's Changed
- Bump dependencies to support PHP 8.4 by @samsonasik in #256
Full Changelog: 12.5.4...12.5.5
Released ECS 12.2.1
What's Changed
- Update Composer Linting Scripts by @Kenneth-Sills in #211
- Add Gitlab / Code Climate Output Format Support by @Kenneth-Sills in #210
- Avoid change chmod by using Nette\Utils\FileSystem with pass null on 3rd argument on write by @samsonasik in #209
New Contributors
- @Kenneth-Sills made their first contribution in #211
Full Changelog: 12.2.0...12.2.1
Released ECS 12.2.0
New Features 🥳
- Add print PHP_CodeSniffer and PHP-CS-Fixer versions when --version (#201), thanks @zonuexe
- Add new output formatter for checkstyle (#204), thanks @M-arcus
- Bump to Rector 1.0
- Bump php-cs-fixer and ecs to latest version
- Implement
--no-diffs
CLI Option (#195), thanks @staabm
Bugfixes 🐛
- [Configuration] Fix parallel config always replaced by next config as default to true
- [Configuration] Do not sets, skip, rules on empty array on ECSConfigBuilder
- Dynamic sets should be configured after sets (#188), thanks @zghosts
- Less memory hungry FnMatchPathNormalizer: reduced by ~35-45% (#192), thanks @staabm
- [Skipper] Allow skip relative path on command line vendor/bin/ecs check path/to/relative/path
- Remove repeated calls to
EasyCodingStandardStyle->isDebug()
(#194), thanks @staabm
Released ECS 10.2.4 with native ECSConfig
Make use of native ECSConfig in ecs.php
Running ECS on Symfony project can create conflict with native ContainerConfigurator
. To avoid that, we introduce a new config, that is fully scoped and isolated within ECS.
Another big advantage is new configuration methods with validation and autocomplete right in your ide 👍
Read more in https://tomasvotruba.com/blog/new-in-ecs-simpler-config/
Before 💀
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
// ups, possible conflict with ContainerConfigurator
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
// too verbose params, constants and possible typo in param value
$parameters->set(Option::PATHS, [[ // ups, "[[" typo
__DIR__ . '/src/',
]]);
$services = $containerConfigurator->services();
$services->set(ArraySyntaxFixer::class);
};
Now 🎉
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([
__DIR__ . '/src',
]);
$ecsConfig->rule(ArraySyntaxFixer::class);
$ecsConfig->sets([SetList::PSR_12]);
};
Up-To 1600 % Faster ECS with Parallel run
ECS gets 100 % faster per 1 CPU thread 🚀
Do you have multi-core CPUs? ECS can run in X parallel threads, where X is number of your threads. E.g. with laptop with AMD Ryzen 4750U it is 16.
That means 1600 % faster run with same amount of analysed files. Did you code base took 16 minutes to fix? Now it's 1 minute.
This feature is:
- experimental - please test and report any issue at https://github.com/symplify/symplify/issues/new 🐛
- should work on Windows too
Do you Want to Safe Time? ⏲️
Try it:
// ecs.php
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PARALLEL, true);
};
And that's it 😉
Aknowledgements
The parallel run is heavily based on @phpstan parallel run - thanks to Ondřej Mirtes for inspiration 🙏
Released ECS 9.3.3
Dowgraded and Scoped version by Default
Since 9.3.3, the package is downgraded to PHP 7.1 and scoped. The former package https://github.com/symplify/easy-coding-standard-prefixed is deprecated and replaced by symplify/easy-coding-standard
should be used instead.
Read more in standalone post https://tomasvotruba.com/blog/introducing-ecs-prefixed-and-downgraded-to-php-71