From 713b047068ce7d17666cd227ab1696eb1289424e Mon Sep 17 00:00:00 2001 From: lubiana Date: Sat, 4 May 2024 19:27:01 +0200 Subject: [PATCH 1/6] add workflow --- .forgejo/workflows/push.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .forgejo/workflows/push.yml diff --git a/.forgejo/workflows/push.yml b/.forgejo/workflows/push.yml new file mode 100644 index 0000000..0754eff --- /dev/null +++ b/.forgejo/workflows/push.yml @@ -0,0 +1,33 @@ +on: [push] +jobs: + ls: + runs-on: docker + container: + image: git.php.fail/lubiana/container/php:ci + steps: + - name: Manually checkout + env: + REPO: '${{ github.repository }}' + TOKEN: '${{ secrets.GITHUB_TOKEN }}' + GIT_SERVER: 'git.php.fail' + COMPOSER_CACHE_DIR: /opt/hostedtoolcache/.composer/cache/files + run: | + git clone --branch $GITHUB_REF_NAME https://${TOKEN}@${GIT_SERVER}/${REPO}.git . + git fetch + git checkout ${{ github.head_ref }} + - name: create composer cache dir + run: | + mkdir -p /opt/hostedtoolcache/.composer/cache/files + - run: composer install + - run: composer lint + - name: GIT commit and push all changed files + env: + CI_COMMIT_MESSAGE: Continuous Integration Fixes + CI_COMMIT_AUTHOR: Continuous Integration + run: | + if [[ -n "$(git status -s)" ]]; then + git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" + git config --global user.email "gitbot@users.noreply.php.fail" + git commit -am "${{ env.CI_COMMIT_MESSAGE }}" + git push + fi \ No newline at end of file From 9993d760d638247795f941f4c4ac7082d2708acb Mon Sep 17 00:00:00 2001 From: lubiana Date: Sat, 4 May 2024 19:41:48 +0200 Subject: [PATCH 2/6] add ClassAttributeSeparationFixer --- config/ecs.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/ecs.php b/config/ecs.php index 28b4812..b5a07ba 100644 --- a/config/ecs.php +++ b/config/ecs.php @@ -77,6 +77,11 @@ return ECSConfig::configure() ] ) ->withConfiguredRule( + \PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer::class, + [ + 'elements' => ['const' => 'none', 'method' => 'one', 'property' => 'none', 'trait_import' => 'none', 'case' => 'none'], + ], + )->withConfiguredRule( DeclareStrictTypesSniff::class, [ 'declareOnFirstLine' => true, From 00f72e3be9bc9afc20bea2b51fa02a3209f31d44 Mon Sep 17 00:00:00 2001 From: Continuous Integration Date: Sat, 4 May 2024 17:42:09 +0000 Subject: [PATCH 3/6] Continuous Integration Fixes --- config/ecs.php | 11 +++++++++-- src/LubiSetList.php | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config/ecs.php b/config/ecs.php index b5a07ba..a964b49 100644 --- a/config/ecs.php +++ b/config/ecs.php @@ -1,5 +1,6 @@ withConfiguredRule( - \PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer::class, + ClassAttributesSeparationFixer::class, [ - 'elements' => ['const' => 'none', 'method' => 'one', 'property' => 'none', 'trait_import' => 'none', 'case' => 'none'], + 'elements' => [ + 'const' => 'none', + 'method' => 'one', + 'property' => 'none', + 'trait_import' => 'none', + 'case' => 'none', + ], ], )->withConfiguredRule( DeclareStrictTypesSniff::class, diff --git a/src/LubiSetList.php b/src/LubiSetList.php index 87017c2..092d20f 100644 --- a/src/LubiSetList.php +++ b/src/LubiSetList.php @@ -5,6 +5,5 @@ namespace Lubiana\CodeQuality; final class LubiSetList { public const string RECTOR = __DIR__ . '/../config/rector.php'; - public const string ECS = __DIR__ . '/../config/ecs.php'; } From e7ecf55e0490442efd8e453d7e4ead368e99ba7b Mon Sep 17 00:00:00 2001 From: lubiana Date: Sat, 4 May 2024 20:24:31 +0200 Subject: [PATCH 4/6] ci-fix --- .forgejo/workflows/push.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/push.yml b/.forgejo/workflows/push.yml index 0754eff..0f5e4de 100644 --- a/.forgejo/workflows/push.yml +++ b/.forgejo/workflows/push.yml @@ -10,15 +10,16 @@ jobs: REPO: '${{ github.repository }}' TOKEN: '${{ secrets.GITHUB_TOKEN }}' GIT_SERVER: 'git.php.fail' - COMPOSER_CACHE_DIR: /opt/hostedtoolcache/.composer/cache/files run: | git clone --branch $GITHUB_REF_NAME https://${TOKEN}@${GIT_SERVER}/${REPO}.git . git fetch git checkout ${{ github.head_ref }} - - name: create composer cache dir + - name: composer install + env: + COMPOSER_CACHE_DIR: /opt/hostedtoolcache/.composer/cache/files run: | - mkdir -p /opt/hostedtoolcache/.composer/cache/files - - run: composer install + mkdir -p ${{ env.COMPOSER_CACHE_DIR }} + composer install - run: composer lint - name: GIT commit and push all changed files env: From e40beaa2d19a7930957a05eb52a6f01fa0406a35 Mon Sep 17 00:00:00 2001 From: lubiana Date: Sun, 18 Aug 2024 09:07:55 +0200 Subject: [PATCH 5/6] bump-dependencies --- composer.json | 6 +++--- composer.lock | 29 ++++++++++++++++------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/composer.json b/composer.json index 688744a..d384621 100644 --- a/composer.json +++ b/composer.json @@ -9,9 +9,9 @@ }, "require": { "php": "^8.3", - "slevomat/coding-standard": "^8.15.0", - "symplify/easy-coding-standard": "^12.1.14", - "rector/rector": "^1.0.4" + "slevomat/coding-standard": "^8.15", + "symplify/easy-coding-standard": "^12.3.5", + "rector/rector": "^1.0.5" }, "config": { "allow-plugins": { diff --git a/composer.lock b/composer.lock index 23de7e5..a57df23 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "43ac5346cfac27bedc2e1990eccc6e6e", + "content-hash": "6eb7806e6594ecc073d158d2f9b483f0", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -191,16 +191,16 @@ }, { "name": "rector/rector", - "version": "1.0.4", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "6e04d0eb087aef707fa0c5686d33d6ff61f4a555" + "reference": "73eb63e4f9011dba6b7c66c3262543014e352f34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/6e04d0eb087aef707fa0c5686d33d6ff61f4a555", - "reference": "6e04d0eb087aef707fa0c5686d33d6ff61f4a555", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/73eb63e4f9011dba6b7c66c3262543014e352f34", + "reference": "73eb63e4f9011dba6b7c66c3262543014e352f34", "shasum": "" }, "require": { @@ -238,7 +238,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/1.0.4" + "source": "https://github.com/rectorphp/rector/tree/1.0.5" }, "funding": [ { @@ -246,7 +246,7 @@ "type": "github" } ], - "time": "2024-04-05T09:01:07+00:00" + "time": "2024-05-10T05:31:15+00:00" }, { "name": "slevomat/coding-standard", @@ -395,16 +395,16 @@ }, { "name": "symplify/easy-coding-standard", - "version": "12.1.14", + "version": "12.3.5", "source": { "type": "git", "url": "https://github.com/easy-coding-standard/easy-coding-standard.git", - "reference": "e3c4a241ee36704f7cf920d5931f39693e64afd5" + "reference": "0d7c2cfee3debdf11c12135e90d69d1d9f4eef03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/easy-coding-standard/easy-coding-standard/zipball/e3c4a241ee36704f7cf920d5931f39693e64afd5", - "reference": "e3c4a241ee36704f7cf920d5931f39693e64afd5", + "url": "https://api.github.com/repos/easy-coding-standard/easy-coding-standard/zipball/0d7c2cfee3debdf11c12135e90d69d1d9f4eef03", + "reference": "0d7c2cfee3debdf11c12135e90d69d1d9f4eef03", "shasum": "" }, "require": { @@ -415,6 +415,9 @@ "phpcsstandards/php_codesniffer": "<3.8", "symplify/coding-standard": "<12.1" }, + "suggest": { + "ext-dom": "Needed to support checkstyle output format in class CheckstyleOutputFormatter" + }, "bin": [ "bin/ecs" ], @@ -437,7 +440,7 @@ ], "support": { "issues": "https://github.com/easy-coding-standard/easy-coding-standard/issues", - "source": "https://github.com/easy-coding-standard/easy-coding-standard/tree/12.1.14" + "source": "https://github.com/easy-coding-standard/easy-coding-standard/tree/12.3.5" }, "funding": [ { @@ -449,7 +452,7 @@ "type": "github" } ], - "time": "2024-02-23T13:10:40+00:00" + "time": "2024-08-08T08:43:50+00:00" } ], "packages-dev": [], From b7e3418f0fa3225d2cdab9cfdcba266bc74775a4 Mon Sep 17 00:00:00 2001 From: lubiana Date: Sun, 18 Aug 2024 09:17:23 +0200 Subject: [PATCH 6/6] remove deprecated rectors --- config/rector.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/rector.php b/config/rector.php index f32142d..c6daf13 100644 --- a/config/rector.php +++ b/config/rector.php @@ -16,7 +16,6 @@ use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector; use Rector\CodingStyle\Rector\If_\NullableCompareToNullRector; use Rector\Config\RectorConfig; use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector; -use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector; use Rector\EarlyReturn\Rector\If_\ChangeNestedIfsToEarlyReturnRector; use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector; use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector; @@ -32,7 +31,6 @@ use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector; use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByParentCallTypeRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnDirectArrayRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector; -use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictBoolReturnExprRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictConstantReturnRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNativeCallRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNewArrayRector; @@ -59,7 +57,6 @@ return RectorConfig::configure() AddReturnTypeDeclarationBasedOnParentClassMethodRector::class, AddReturnTypeDeclarationFromYieldsRector::class, BooleanNotIdenticalToNotIdenticalRector::class, - ChangeAndIfToEarlyReturnRector::class, ChangeNestedForeachIfsToEarlyContinueRector::class, ChangeNestedIfsToEarlyReturnRector::class, ChangeOrIfContinueToMultiContinueRector::class, @@ -78,7 +75,6 @@ return RectorConfig::configure() ReturnEarlyIfVariableRector::class, ReturnTypeFromReturnDirectArrayRector::class, ReturnTypeFromReturnNewRector::class, - ReturnTypeFromStrictBoolReturnExprRector::class, ReturnTypeFromStrictConstantReturnRector::class, ReturnTypeFromStrictNativeCallRector::class, ReturnTypeFromStrictNewArrayRector::class,