Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add recipe for frosh/code-quality-meta:v0.3.0 #85

Merged
merged 1 commit into from
Mar 1, 2024
Merged

fix: Add recipe for frosh/code-quality-meta:v0.3.0 #85

merged 1 commit into from
Mar 1, 2024

Conversation

ioanok
Copy link
Contributor

@ioanok ioanok commented Mar 1, 2024

Use phpstan-bootstrap from Shopware core
Use latest frosh/shopware-rector version

Copy link

github-actions bot commented Mar 1, 2024

Thanks for the PR 😍

How to test these changes in your application

  1. Add the Shopware flex endpoint in your composer.json to https://raw.githubusercontent.com/shopware/recipes/flex/pull-85/index.json.

    # When jq is installed
    jq '.extra.symfony.endpoint |= [ "https://raw.githubusercontent.com/shopware/recipes/flex/pull-85/index.json" ] + .' composer.json > composer.tmp && mv composer.tmp composer.json

    or manually

    "endpoint": [
        "https://raw.githubusercontent.com/shopware/recipes/flex/pull-85/index.json",
        "https://raw.githubusercontent.com/shopware/recipes/flex/main/index.json",
        "flex://defaults"
    ]
  2. Install the package(s) related to this recipe:

    composer req 'frosh/code-quality-meta:^0.3'

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes.
I'm going keep this comment up to date with any updates of the attached patch.

frosh/code-quality-meta

0.1 vs 0.2
diff --git a/frosh/code-quality-meta/0.1/root/rector.php b/frosh/code-quality-meta/0.2/root/rector.php
index 30bc217..28bd0a0 100644
--- a/frosh/code-quality-meta/0.1/root/rector.php
+++ b/frosh/code-quality-meta/0.2/root/rector.php
@@ -4,13 +4,12 @@ declare(strict_types=1);
 
 use Frosh\Rector\Set\ShopwareSetList;
 use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
-use Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToArrayFilterRector;
 use Rector\Config\RectorConfig;
 use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
 use Rector\PostRector\Rector\NameImportingPostRector;
 use Rector\Set\ValueObject\LevelSetList;
 use Rector\Set\ValueObject\SetList;
-use Rector\Symfony\Rector\Return_\SimpleFunctionAndFilterRector;
+use Rector\Symfony\Twig134\Rector\Return_\SimpleFunctionAndFilterRector;
 use Rector\Symfony\Set\SymfonySetList;
 
 return static function (RectorConfig $rectorConfig): void {
@@ -27,7 +26,6 @@ return static function (RectorConfig $rectorConfig): void {
 
     $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
     $rectorConfig->rule(NameImportingPostRector::class);
-    $rectorConfig->rule(SimplifyForeachToArrayFilterRector::class);
     $rectorConfig->rule(SimpleFunctionAndFilterRector::class);
 
     $rectorConfig->sets([
@@ -37,10 +35,13 @@ return static function (RectorConfig $rectorConfig): void {
         SymfonySetList::SYMFONY_60,
         SymfonySetList::SYMFONY_61,
         SymfonySetList::SYMFONY_62,
+        SymfonySetList::SYMFONY_63,
         SymfonySetList::SYMFONY_CODE_QUALITY,
         SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
         LevelSetList::UP_TO_PHP_81,
+        LevelSetList::UP_TO_PHP_82,
         ShopwareSetList::SHOPWARE_6_5_0,
+        ShopwareSetList::SHOPWARE_6_6_0,
     ]);
 
     $rectorConfig->skip([
diff --git a/frosh/code-quality-meta/0.1/vendor-bin/rector/composer.json b/frosh/code-quality-meta/0.2/vendor-bin/rector/composer.json
index 801401b..7f86567 100644
--- a/frosh/code-quality-meta/0.1/vendor-bin/rector/composer.json
+++ b/frosh/code-quality-meta/0.2/vendor-bin/rector/composer.json
@@ -1,6 +1,6 @@
 {
     "require-dev": {
-        "rector/rector": "^0.15.24",
-        "frosh/shopware-rector": "^0.1.0"
+        "rector/rector": "^0.17.3",
+        "frosh/shopware-rector": "^0.2.2"
     }
 }
0.2 vs 0.3
diff --git a/frosh/code-quality-meta/0.2/post-install.txt b/frosh/code-quality-meta/0.3/post-install.txt
index d52763e..1eb5b98 100644
--- a/frosh/code-quality-meta/0.2/post-install.txt
+++ b/frosh/code-quality-meta/0.3/post-install.txt
@@ -9,7 +9,7 @@
             "ecs": "@php vendor-bin/cs-fixer/vendor/bin/ecs check custom/static-plugins custom/plugins",
             "ecs-fix": "@php vendor-bin/cs-fixer/vendor/bin/ecs check --fix custom/static-plugins custom/plugins",
             "phpstan": [
-              "@php vendor/frosh/code-quality-meta/phpstan-bootstrap.php",
+              "@php vendor/shopware/core/DevOps/StaticAnalyze/phpstan-bootstrap.php",
               "@php vendor-bin/phpstan/vendor/bin/phpstan analyze custom/static-plugins custom/plugins"
             ],
             "rector-dry": "@php vendor-bin/rector/vendor/bin/rector process --config=rector.php --dry-run",
diff --git a/frosh/code-quality-meta/0.2/root/phpstan.neon.dist b/frosh/code-quality-meta/0.3/root/phpstan.neon.dist
index 834e5ab..f56430b 100644
--- a/frosh/code-quality-meta/0.2/root/phpstan.neon.dist
+++ b/frosh/code-quality-meta/0.3/root/phpstan.neon.dist
@@ -9,7 +9,7 @@ parameters:
         containerXmlPath: 'var/cache/phpstan_dev/Shopware_Core_DevOps_StaticAnalyze_StaticAnalyzeKernelPhpstan_devDebugContainer.xml'
 
     bootstrapFiles:
-        - vendor/frosh/code-quality-meta/phpstan-bootstrap.php
+        - vendor/shopware/core/DevOps/StaticAnalyze/phpstan-bootstrap.php
 
     excludePaths:
         - **/vendor/*
diff --git a/frosh/code-quality-meta/0.2/root/rector.php b/frosh/code-quality-meta/0.3/root/rector.php
index 28bd0a0..b3bd77c 100644
--- a/frosh/code-quality-meta/0.2/root/rector.php
+++ b/frosh/code-quality-meta/0.3/root/rector.php
@@ -26,6 +26,7 @@ return static function (RectorConfig $rectorConfig): void {
 
     $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
     $rectorConfig->rule(NameImportingPostRector::class);
+
     $rectorConfig->rule(SimpleFunctionAndFilterRector::class);
 
     $rectorConfig->sets([
diff --git a/frosh/code-quality-meta/0.2/vendor-bin/rector/composer.json b/frosh/code-quality-meta/0.3/vendor-bin/rector/composer.json
index 7f86567..e1dc77f 100644
--- a/frosh/code-quality-meta/0.2/vendor-bin/rector/composer.json
+++ b/frosh/code-quality-meta/0.3/vendor-bin/rector/composer.json
@@ -1,6 +1,6 @@
 {
     "require-dev": {
-        "rector/rector": "^0.17.3",
-        "frosh/shopware-rector": "^0.2.2"
+        "rector/rector": "^0.19.2",
+        "frosh/shopware-rector": "^0.3.0"
     }
 }

@shyim shyim merged commit 089bc7e into shopware:main Mar 1, 2024
1 check passed
@shyim
Copy link
Member

shyim commented Mar 1, 2024

Thank you!

@ioanok ioanok deleted the update-code-quality-recipe branch March 1, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants