From 67238d841a46b5fecc9ef204ffef4ba773e82cb9 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 8 Aug 2024 15:51:11 +0200 Subject: [PATCH] [docs] add note about new find-rule page (#6224) * cs * [docs] add note about new find-rule page * update link in README * [ci] add validate rules docs check --- .github/workflows/code_analysis.yaml | 4 ++++ build/target-repository/README.md | 2 +- build/target-repository/docs/rector_rules_overview.md | 4 ++++ composer.json | 7 ++----- .../CodeQuality/Rector/Foreach_/ForeachToInArrayRector.php | 4 +++- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index 57a058950af..c11f0a3f45b 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -33,6 +33,10 @@ jobs: name: 'Commented Code' run: vendor/bin/swiss-knife check-commented-code src rules tests rules-tests --line-limit 5 --ansi + - + name: "Validate docs" + run: vendor/bin/rule-doc-generator validate rules + - name: 'Active Classes' run: | diff --git a/build/target-repository/README.md b/build/target-repository/README.md index 982915f86ca..36dc7effb34 100644 --- a/build/target-repository/README.md +++ b/build/target-repository/README.md @@ -72,7 +72,7 @@ vendor/bin/rector process src ## Documentation * Find [full documentation here](https://getrector.com/documentation/). -* [Explore Rector Rules](/docs/rector_rules_overview.md) +* [Explore Rector Rules](https://getrector.com/find-rule)
diff --git a/build/target-repository/docs/rector_rules_overview.md b/build/target-repository/docs/rector_rules_overview.md index fe087979335..71a923d14be 100644 --- a/build/target-repository/docs/rector_rules_overview.md +++ b/build/target-repository/docs/rector_rules_overview.md @@ -1,5 +1,9 @@ # 382 Rules Overview +**This overview is deprecated and replaced by more advanced web search. There you can search and filter by nodes, copy-paste configs for configurable rules and more.** + +Use https://getrector.com/find-rule instead! +
## Categories diff --git a/composer.json b/composer.json index 8cbda3e3ac5..44f5780b6b2 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,7 @@ "symplify/easy-coding-standard": "^12.3", "symplify/phpstan-extensions": "^11.4", "symplify/phpstan-rules": "^13.0", - "symplify/rule-doc-generator": "^12.2.2", + "symplify/rule-doc-generator": "^12.2.5", "symplify/vendor-patches": "^11.3", "tomasvotruba/class-leak": "^0.2.15", "tomasvotruba/unused-public": "^0.3.10", @@ -110,10 +110,7 @@ "check-cs": "vendor/bin/ecs check --ansi", "fix-cs": "vendor/bin/ecs check --fix --ansi", "phpstan": "vendor/bin/phpstan analyse --ansi --error-format symplify --memory-limit=512M", - "docs": [ - "vendor/bin/rule-doc-generator generate rules --output-file build/rector_rules_overview.md --ansi --categorize 3", - "mv build/rector_rules_overview.md build/target-repository/docs/rector_rules_overview.md" - ], + "docs": "vendor/bin/rule-doc-generator validate rules", "rector": "bin/rector process --ansi", "preload": "php build/build-preload.php .", "release": " vendor/bin/rng --from-commit X --to-commit Y --remote-repository rectorphp/rector-symfony --remote-repository rectorphp/rector-doctrine --remote-repository rectorphp/rector-phpunit" diff --git a/rules/CodeQuality/Rector/Foreach_/ForeachToInArrayRector.php b/rules/CodeQuality/Rector/Foreach_/ForeachToInArrayRector.php index e000967b7b9..ba35cd65f1e 100644 --- a/rules/CodeQuality/Rector/Foreach_/ForeachToInArrayRector.php +++ b/rules/CodeQuality/Rector/Foreach_/ForeachToInArrayRector.php @@ -170,7 +170,9 @@ private function shouldSkipForeach(Foreach_ $foreach): bool return true; } - return ! $this->nodeTypeResolver->getNativeType($foreach->expr)->isArray()->yes(); + return ! $this->nodeTypeResolver->getNativeType($foreach->expr) + ->isArray() + ->yes(); } private function shouldSkipIf(If_ $if): bool