diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..fca3e08 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* jindrich.pech@almamedia.com diff --git a/CHANGELOG.md b/CHANGELOG.md index 12aba2a..efc8348 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,7 +87,7 @@ - Temporarily disable `ArrayDeclarationSniff.ValueNoNewline` because of [bug](https://github.com/squizlabs/PHP_CodeSniffer/issues/2937) in PHP_CodeSniffer 3.5.5. ## 2.0.0 - 2020-03-02 -- BC: change the way the standard is imported to your `easy-coding-standard.yaml` (change `%vendor_dir%` placeholder directly to name of the vendor directory like `vendor`). See example in [README](https://github.com/lmc-eu/php-coding-standard#usage). +- BC: change the way the standard is imported to your `easy-coding-standard.yaml` (change `%vendor_dir%` placeholder directly to name of the vendor directory like `vendor`). See example in [README](https://github.com/alma-oss/php-coding-standard#usage). - Drop PHP 7.1 support. - Require EasyCodingStandard 7+. - `VisibilityRequiredFixer` now check visibility is declared also on class constants. diff --git a/README.md b/README.md index ead7009..5363a90 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Alma Career Czechia Coding Standard for PHP +# Alma Career Coding Standard for PHP [![Latest Stable Version](https://img.shields.io/packagist/v/lmc/coding-standard.svg?style=flat-square)](https://packagist.org/packages/lmc/coding-standard) -PHP coding standard used in [Alma Career Czechia][Alma Career] (formerly LMC) products. +PHP coding standard used in [Alma Career][Alma Career] (formerly LMC) products. The standard is based on [PSR-12][psr-12] and partially [PER 2.0][per-2] and adds various checks to make sure the code is readable, follows the same conventions, and does not contain common mistakes. @@ -22,6 +22,7 @@ composer require --dev lmc/coding-standard ```php withRootFiles() // to also check ecs.php and all other php files in the root directory ->withSets( [ - __DIR__ . '/vendor/lmc/coding-standard/ecs.php', + SetList::ALMACAREER, ] ); ``` @@ -67,6 +68,7 @@ Below find examples of some more opinionated checks you may want to add dependin ```php withSets( [ - __DIR__ . '/vendor/lmc/coding-standard/ecs.php', + SetList::ALMACAREER, ] ) ->withRules( diff --git a/UPGRADE-4.0.md b/UPGRADE-4.0.md index 590c5cb..f97034f 100644 --- a/UPGRADE-4.0.md +++ b/UPGRADE-4.0.md @@ -35,7 +35,7 @@ Now change the way you set rules, skip tests and import sets: | `$parameters->set(Option::SKIP, ...)` | `ECSConfig::configure()->withSkip()` | | `$containerConfigurator->import()` | `ECSConfig::configure()->withSets()` | -See [examples in Usage section of our README](https://github.com/lmc-eu/php-coding-standard?tab=readme-ov-file#usage) +See [examples in Usage section of our README](https://github.com/alma-oss/php-coding-standard?tab=readme-ov-file#usage) or more configuration options in [ECS documentation](https://github.com/easy-coding-standard/easy-coding-standard/tree/main?tab=readme-ov-file#configure). Some more reasoning and examples of configurations can also be seen [in ECS author blogpost](https://tomasvotruba.com/blog/new-in-ecs-simpler-config). @@ -88,7 +88,7 @@ $ vendor/bin/ecs check --ansi # new ### 6. Add some optional rules On top of default rules included in ecs.php, there are some more opinionated ones you may want to add. -These suggested rules are listed in [README.md](https://github.com/lmc-eu/php-coding-standard?tab=readme-ov-file#add-custom-checks-or-override-default-settings). +These suggested rules are listed in [README.md](https://github.com/alma-oss/php-coding-standard?tab=readme-ov-file#add-custom-checks-or-override-default-settings). ### 5. BE CAREFUL WITH SUGGESTED CHANGES! ⚠️ diff --git a/composer.json b/composer.json index c9d0d06..d3785bf 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,12 @@ { "name": "lmc/coding-standard", - "description": "Coding standard used in Alma Career Czechia (LMC) projects", + "description": "Coding standard used in Alma Career projects", "license": "MIT", "type": "library", "authors": [ { "name": "Alma Career", - "homepage": "https://github.com/almacareer/" + "homepage": "https://github.com/alma-oss/" } ], "require": { diff --git a/ecs-internal.php b/ecs-internal.php index 944036e..1cdb314 100644 --- a/ecs-internal.php +++ b/ecs-internal.php @@ -1,5 +1,6 @@ withRootFiles() ->withSets( [ - __DIR__ . '/ecs.php', + SetList::ALMACAREER, ], ) ->withConfiguredRule(PhpUnitTestAnnotationFixer::class, ['style' => 'annotation']) diff --git a/src/Set/SetList.php b/src/Set/SetList.php new file mode 100644 index 0000000..4f30ece --- /dev/null +++ b/src/Set/SetList.php @@ -0,0 +1,11 @@ +