diff --git a/.forgejo/workflows/push.yml b/.forgejo/workflows/push.yml new file mode 100644 index 0000000..0f5e4de --- /dev/null +++ b/.forgejo/workflows/push.yml @@ -0,0 +1,34 @@ +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' + run: | + git clone --branch $GITHUB_REF_NAME https://${TOKEN}@${GIT_SERVER}/${REPO}.git . + git fetch + git checkout ${{ github.head_ref }} + - name: composer install + env: + COMPOSER_CACHE_DIR: /opt/hostedtoolcache/.composer/cache/files + run: | + mkdir -p ${{ env.COMPOSER_CACHE_DIR }} + 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 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": [], diff --git a/config/ecs.php b/config/ecs.php index 28b4812..a964b49 100644 --- a/config/ecs.php +++ b/config/ecs.php @@ -1,5 +1,6 @@ withConfiguredRule( + ClassAttributesSeparationFixer::class, + [ + 'elements' => [ + 'const' => 'none', + 'method' => 'one', + 'property' => 'none', + 'trait_import' => 'none', + 'case' => 'none', + ], + ], + )->withConfiguredRule( DeclareStrictTypesSniff::class, [ 'declareOnFirstLine' => true, 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, 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'; }