From 4d7531b9a6bb14bc6f723ee94382d5ecb4f036c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 23 Oct 2020 09:11:48 +0200 Subject: [PATCH] Enhancement: Synchronize with ergebnis/php-library-template --- .gitattributes | 2 +- .github/CODEOWNERS | 1 + .../composer/determine-cache-directory/action.yaml | 2 +- .github/actions/composer/composer/install/run.sh | 6 +++--- .github/{dependabot.yml => dependabot.yaml} | 0 .github/workflows/integrate.yaml | 8 ++++---- .github/workflows/renew.yaml | 2 +- {tools => .phive}/composer-require-checker | Bin .php_cs | 5 +---- Makefile | 7 +++---- phive.xml | 2 +- psalm-baseline.xml | 9 +-------- 12 files changed, 17 insertions(+), 27 deletions(-) create mode 100644 .github/CODEOWNERS rename .github/{dependabot.yml => dependabot.yaml} (100%) rename {tools => .phive}/composer-require-checker (100%) diff --git a/.gitattributes b/.gitattributes index 79ecf3ae..d62bb983 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,6 @@ /.github/ export-ignore +/.phive/ export-ignore /test/ export-ignore -/tools/ export-ignore /.editorconfig export-ignore /.gitattributes export-ignore /.gitignore export-ignore diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..01c24919 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @ergebnis-bot @localheinz diff --git a/.github/actions/composer/composer/determine-cache-directory/action.yaml b/.github/actions/composer/composer/determine-cache-directory/action.yaml index a898fdaa..4842e88c 100644 --- a/.github/actions/composer/composer/determine-cache-directory/action.yaml +++ b/.github/actions/composer/composer/determine-cache-directory/action.yaml @@ -13,4 +13,4 @@ runs: steps: - name: "Determine composer cache directory" shell: "bash" - run: "echo \"::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)\"" + run: "echo \"COMPOSER_CACHE_DIR=$(composer config cache-dir)\" >> $GITHUB_ENV" diff --git a/.github/actions/composer/composer/install/run.sh b/.github/actions/composer/composer/install/run.sh index dddf3039..3cc3df12 100755 --- a/.github/actions/composer/composer/install/run.sh +++ b/.github/actions/composer/composer/install/run.sh @@ -5,19 +5,19 @@ dependencies="${COMPOSER_INSTALL_DEPENDENCIES}" if [[ ${dependencies} == "lowest" ]]; then composer update --no-interaction --no-progress --no-suggest --prefer-lowest - exit 0 + exit $? fi if [[ ${dependencies} == "locked" ]]; then composer install --no-interaction --no-progress --no-suggest - exit 0 + exit $? fi if [[ ${dependencies} == "highest" ]]; then composer update --no-interaction --no-progress --no-suggest - exit 0 + exit $? fi echo "::error::The value for the \"dependencies\" input needs to be one of \"lowest\", \"locked\"', \"highest\"' - got \"${dependencies}\" instead." diff --git a/.github/dependabot.yml b/.github/dependabot.yaml similarity index 100% rename from .github/dependabot.yml rename to .github/dependabot.yaml diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index f7ce3bef..c3eac1bf 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -74,7 +74,7 @@ jobs: uses: "actions/cache@v2.1.2" with: path: ".build/php-cs-fixer" - key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('composer.lock') }}" + key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}" restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-" - name: "Run friendsofphp/php-cs-fixer" @@ -120,7 +120,7 @@ jobs: dependencies: "${{ matrix.dependencies }}" - name: "Run maglnet/composer-require-checker" - run: "tools/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json" + run: ".phive/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json" static-code-analysis: name: "Static Code Analysis" @@ -185,7 +185,7 @@ jobs: restore-keys: "php-${{ matrix.php-version }}-psalm-" - name: "Run vimeo/psalm" - run: "vendor/bin/psalm --config=psalm.xml --diff --diff-methods --shepherd --show-info=false --stats --threads=4" + run: "vendor/bin/psalm --config=psalm.xml --diff --shepherd --show-info=false --stats --threads=4" tests: name: "Tests" @@ -285,7 +285,7 @@ jobs: dependencies: "${{ matrix.dependencies }}" - name: "Collect code coverage with pcov and phpunit/phpunit" - run: "vendor/bin/phpunit --configuration=test/Integration/phpunit.xml --coverage-clover=.build/logs/clover.xml" + run: "vendor/bin/phpunit --configuration=test/Integration/phpunit.xml --coverage-clover=.build/phpunit/logs/clover.xml" - name: "Send code coverage report to Codecov.io" env: diff --git a/.github/workflows/renew.yaml b/.github/workflows/renew.yaml index 40a7f94c..442522d9 100644 --- a/.github/workflows/renew.yaml +++ b/.github/workflows/renew.yaml @@ -61,7 +61,7 @@ jobs: uses: "actions/cache@v2.1.2" with: path: ".build/php-cs-fixer" - key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('composer.lock') }}" + key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}" restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-" - name: "Run friendsofphp/php-cs-fixer" diff --git a/tools/composer-require-checker b/.phive/composer-require-checker similarity index 100% rename from tools/composer-require-checker rename to .phive/composer-require-checker diff --git a/.php_cs b/.php_cs index 6f5e1210..721ebdcf 100644 --- a/.php_cs +++ b/.php_cs @@ -37,10 +37,7 @@ $config->getFinder() '.notes/', 'test/Fixture/', ]) - ->name([ - '.php_cs', - '.php_cs.fixture', - ]); + ->name('.php_cs'); $config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/.php_cs.cache'); diff --git a/Makefile b/Makefile index e1f6b9e9..30541784 100644 --- a/Makefile +++ b/Makefile @@ -15,11 +15,10 @@ coding-standards: vendor ## Normalizes composer.json with ergebnis/composer-norm yamllint -c .yamllint.yaml --strict . mkdir -p .build/php-cs-fixer vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --verbose - vendor/bin/php-cs-fixer fix --config=.php_cs.fixture --diff --diff-format=udiff --verbose .PHONY: dependency-analysis dependency-analysis: vendor ## Runs a dependency analysis with maglnet/composer-require-checker - tools/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 .PHONY: help help: ## Displays this list of targets with descriptions @@ -35,13 +34,13 @@ static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan mkdir -p .build/phpstan vendor/bin/phpstan analyse --configuration=phpstan.neon --memory-limit=-1 mkdir -p .build/psalm - vendor/bin/psalm --config=psalm.xml --diff --diff-methods --show-info=false --stats --threads=4 + vendor/bin/psalm --config=psalm.xml --diff --show-info=false --stats --threads=4 .PHONY: static-code-analysis-baseline static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with phpstan/phpstan and vimeo/psalm mkdir -p .build/phpstan echo '' > phpstan-baseline.neon - vendor/bin/phpstan analyze --configuration=phpstan.neon --error-format=baselineNeon > phpstan-baseline.neon || true + vendor/bin/phpstan analyze --configuration=phpstan.neon --error-format=baselineNeon --memory-limit=-1 > phpstan-baseline.neon || true mkdir -p .build/psalm vendor/bin/psalm --config=psalm.xml --set-baseline=psalm-baseline.xml diff --git a/phive.xml b/phive.xml index a88a0a03..b7a46302 100644 --- a/phive.xml +++ b/phive.xml @@ -1,4 +1,4 @@ - + diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 41479c44..23aaa551 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,13 +1,6 @@ - + - - $docComment->getReformattedText() - $annotation - - - $annotation - true === $allowAbstractClasses