From cf292462110da38da56b9937743a3ecf5081410f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 28 Nov 2023 17:23:38 +0100 Subject: [PATCH] Enhancement: Synchronize with ergebnis/php-cs-fixer-config-template --- .github/CONTRIBUTING.md | 20 ++++++++++---------- .github/workflows/integrate.yaml | 2 +- .phive/phars.xml | 2 +- Makefile | 2 +- README.md | 16 ++++++++-------- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 31c7b47f..6681e8c2 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,6 +1,6 @@ # CONTRIBUTING -We are using [GitHub Actions](https://github.com/features/actions) as a continuous integration system. +We use [GitHub Actions](https://github.com/features/actions) as a continuous integration system. For details, take a look at the following workflow configuration files: @@ -12,9 +12,9 @@ For details, take a look at the following workflow configuration files: ## Coding Standards -We are using [`ergebnis/composer-normalize`](https://github.com/ergebnis/composer-normalize) to normalize `composer.json`. +We use [`ergebnis/composer-normalize`](https://github.com/ergebnis/composer-normalize) to normalize `composer.json`. -We are using [`yamllint`](https://github.com/adrienverge/yamllint) to enforce coding standards in YAML files. +We use [`yamllint`](https://github.com/adrienverge/yamllint) to enforce coding standards in YAML files. If you do not have `yamllint` installed yet, run @@ -24,7 +24,7 @@ brew install yamllint to install `yamllint`. -We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce coding standards in PHP files. +We use [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce coding standards in PHP files. Run @@ -36,7 +36,7 @@ to automatically fix coding standard violations. ## Dependency Analysis -We are using [`maglnet/composer-require-checker`](https://github.com/maglnet/ComposerRequireChecker) to prevent the use of unknown symbols in production code. +We use [`maglnet/composer-require-checker`](https://github.com/maglnet/ComposerRequireChecker) to prevent the use of unknown symbols in production code. Run @@ -48,7 +48,7 @@ to run a dependency analysis. ## Refactoring -We are using [`rector/rector`](https://github.com/rectorphp/rector) to automatically refactor code. +We use [`rector/rector`](https://github.com/rectorphp/rector) to automatically refactor code. Run @@ -60,7 +60,7 @@ to automatically refactor code. ## Security Analysis -We are using [`composer`](https://github.com/composer/composer) to run a security analysis. +We use [`composer`](https://github.com/composer/composer) to run a security analysis. Run @@ -72,7 +72,7 @@ to run a security analysis. ## Static Code Analysis -We are using [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code. +We use [`phpstan/phpstan`](https://github.com/phpstan/phpstan) and [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code. Run @@ -82,7 +82,7 @@ make static-code-analysis to run a static code analysis. -We are also using the baseline feature of [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file). +We also use the baseline feature of [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file). Run @@ -96,7 +96,7 @@ to regenerate the baseline in [`../psalm-baseline.xml`](../psalm-baseline.xml). ## Tests -We are using [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) to drive the development. +We use [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) to drive the development. Run diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 8449e467..8b295b0d 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -196,7 +196,7 @@ jobs: trust-gpg-keys: "0x033E5F8D801A2F8D" - name: "Run maglnet/composer-require-checker" - run: ".phive/composer-require-checker check --ansi --config-file=$(pwd)/composer-require-checker.json" + run: ".phive/composer-require-checker check --ansi --config-file=$(pwd)/composer-require-checker.json --verbose" refactoring: name: "Refactoring" diff --git a/.phive/phars.xml b/.phive/phars.xml index c109a18d..f346d4ee 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,4 +1,4 @@ - + diff --git a/Makefile b/Makefile index 668abe0b..c9c40a69 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ coding-standards: vendor ## Lints YAML files with yamllint, normalizes composer. .PHONY: dependency-analysis dependency-analysis: phive vendor ## Runs a dependency analysis with maglnet/composer-require-checker - .phive/composer-require-checker check --config-file=$(shell pwd)/composer-require-checker.json + .phive/composer-require-checker check --config-file=$(shell pwd)/composer-require-checker.json --verbose .PHONY: help help: ## Displays this list of targets with descriptions diff --git a/README.md b/README.md index f6596ce7..2a6e908f 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ declare(strict_types=1); use Ergebnis\PhpCsFixer\Config; -$ruleSet = Config\RuleSet\Php82::create(); +$ruleSet = Config\RuleSet\Php83::create(); $config = Config\Factory::fromRuleSet($ruleSet); @@ -90,8 +90,8 @@ All configuration examples use the caching feature, and if you want to use it as +@see https://github.com/ergebnis/php-cs-fixer-config +EOF; --$ruleSet = Config\RuleSet\Php82::create(); -+$ruleSet = Config\RuleSet\Php82::create()->withHeader($header); +-$ruleSet = Config\RuleSet\Php83::create(); ++$ruleSet = Config\RuleSet\Php83::create()->withHeader($header); $config = Config\Factory::fromRuleSet($ruleSet); @@ -129,8 +129,8 @@ This will enable and configure the [`HeaderCommentFixer`](https://github.com/Fri use Ergebnis\PhpCsFixer\Config; --$ruleSet = Config\RuleSet\Php82::create(); -+$ruleSet = Config\RuleSet\Php82::create()->withRules(Config\Rules::fromArray([ +-$ruleSet = Config\RuleSet\Php83::create(); ++$ruleSet = Config\RuleSet\Php83::create()->withRules(Config\Rules::fromArray([ + 'mb_str_functions' => false, + 'strict_comparison' => false, +])); @@ -155,8 +155,8 @@ This will enable and configure the [`HeaderCommentFixer`](https://github.com/Fri use Ergebnis\PhpCsFixer\Config; use FooBar\Fixer; --$ruleSet = Config\RuleSet\Php82::create(); -+$ruleSet = Config\RuleSet\Php82::create() +-$ruleSet = Config\RuleSet\Php83::create(); ++$ruleSet = Config\RuleSet\Php83::create() + ->withCustomFixers(Config\Fixers::fromFixers( + new Fixer\BarBazFixer(), + new Fixer\QuzFixer(), @@ -211,7 +211,7 @@ If you like [`composer` scripts](https://getcomposer.org/doc/articles/scripts.md "php": "^8.1", }, "require-dev": { - "ergebnis/php-cs-fixer-config": "~5.1.0" + "ergebnis/php-cs-fixer-config": "~6.12.0" + }, + "scripts": { + "coding-standards": [