From bc9aec9b3c733f50ba657bbd0e6cab87f713bdbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pech=20Jind=C5=99ich?= Date: Thu, 27 Feb 2025 14:14:35 +0100 Subject: [PATCH 1/5] Add codeowners --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS 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 From ac9b1e9e347569951fd5d45811834e0f440afc25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Machulda?= Date: Thu, 27 Feb 2025 14:11:21 +0100 Subject: [PATCH 2/5] Rename Alma Career Czechia to Alma Career Coding Standard for PHP --- README.md | 4 ++-- composer.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ead7009..d9bb784 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. 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": { From d60fc609bff76bb2239052a72c0729ca8f42345b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Machulda?= Date: Thu, 27 Feb 2025 14:24:04 +0100 Subject: [PATCH 3/5] Rename links to repository to alma-oss/php-coding-standard --- CHANGELOG.md | 2 +- UPGRADE-4.0.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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/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! ⚠️ From dbb53261671b15234cb4836f8bafb8a64cc4580d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Fri, 3 Jan 2025 20:04:34 +0000 Subject: [PATCH 4/5] Add Almacareer SetList --- README.md | 6 ++++-- src/Set/SetList.php | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 src/Set/SetList.php diff --git a/README.md b/README.md index d9bb784..5363a90 100644 --- a/README.md +++ b/README.md @@ -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/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 @@ + Date: Thu, 27 Feb 2025 15:30:01 +0100 Subject: [PATCH 5/5] Use Almacareer setlist in internal ecs rules --- ecs-internal.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'])