Skip to content

Commit

Permalink
Enhancement: Synchronize with ergebnis/php-library-template
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Oct 23, 2020
1 parent cd9c9a6 commit 4d7531b
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ergebnis-bot @localheinz
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 3 additions & 3 deletions .github/actions/composer/composer/install/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/renew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
5 changes: 1 addition & 4 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion phive.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="composer-require-checker" version="^2.1.0" installed="2.1.0" location="./tools/composer-require-checker" copy="true"/>
<phar name="composer-require-checker" version="^2.1.0" installed="2.1.0" location="./.phive/composer-require-checker" copy="true"/>
</phive>
9 changes: 1 addition & 8 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.14.2@3538fe1955d47f6ee926c0769d71af6db08aa488">
<files psalm-version="3.18.2@19aa905f7c3c7350569999a93c40ae91ae4e1626">
<file src="src/Classes/FinalRule.php">
<MixedArgument occurrences="2">
<code>$docComment-&gt;getReformattedText()</code>
<code>$annotation</code>
</MixedArgument>
<MixedAssignment occurrences="1">
<code>$annotation</code>
</MixedAssignment>
<MixedPropertyTypeCoercion occurrences="1"/>
<RedundantIdentityWithTrue occurrences="1">
<code>true === $allowAbstractClasses</code>
Expand Down

0 comments on commit 4d7531b

Please sign in to comment.