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

Enhancement: Synchronize with ergebnis/php-package-template #159

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
/composer.lock export-ignore
/infection.json export-ignore
/Makefile export-ignore
/psalm-baseline.xml export-ignore
/psalm.xml export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/rector.php export-ignore
8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CONTRIBUTING
# Contributing

We use [GitHub Actions](https://github.com/features/actions) as a continuous integration system.

Expand Down Expand Up @@ -84,7 +84,7 @@ to run a security analysis.

## Static Code Analysis

We use [`phpstan/phpstan`](https://github.com/phpstan/phpstan) and [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code.
We use [`phpstan/phpstan`](https://github.com/phpstan/phpstan) to statically analyze the code.

Run

Expand All @@ -94,15 +94,15 @@ make static-code-analysis

to run a static code analysis.

We also use 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 [`phpstan/phpstan`](https://phpstan.org/user-guide/baseline).

Run

```sh
make static-code-analysis-baseline
```

to regenerate the baseline in [`../psalm-baseline.xml`](../psalm-baseline.xml).
to regenerate the baseline in [`../phpstan-baseline.neon`](../phpstan-baseline.neon).

:exclamation: Ideally, the baseline should shrink over time.

Expand Down
4 changes: 2 additions & 2 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ updates:
open-pull-requests-limit: 10
package-ecosystem: "composer"
schedule:
interval: "daily"
interval: "weekly"
versioning-strategy: "increase"

- commit-message:
Expand All @@ -26,4 +26,4 @@ updates:
open-pull-requests-limit: 10
package-ecosystem: "github-actions"
schedule:
interval: "daily"
interval: "weekly"
12 changes: 6 additions & 6 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Run vimeo/psalm"
run: "vendor/bin/psalm --config=psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4"
- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan --ansi --configuration=phpstan.neon --memory-limit=-1"

tests:
name: "Tests"
Expand Down Expand Up @@ -458,14 +458,14 @@ jobs:
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Remove platform configuration with composer"
if: "matrix.dependencies != 'locked'"
run: "composer config platform.php --ansi --unset"

- name: "Remove incompatible dependencies with composer"
if: "matrix.dependencies != 'locked'"
run: "composer remove ergebnis/php-cs-fixer-config infection/infection psalm/plugin-phpunit vimeo/psalm --ansi --dev --no-interaction --no-progress"

- name: "Remove platform configuration with composer"
if: "matrix.dependencies != 'locked'"
run: "composer config platform.php --ansi --unset"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "ergebnis/.github/actions/composer/[email protected]"
with:
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
it: refactoring coding-standards security-analysis static-code-analysis tests ## Runs the refactoring, coding-standards, security-analysis, static-code-analysis, and tests targets

.PHONY: code-coverage
code-coverage: vendor ## Collects coverage from running unit tests with phpunit/phpunit
code-coverage: vendor ## Collects code coverage from running unit tests with phpunit/phpunit
vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-text

.PHONY: coding-standards
Expand Down Expand Up @@ -36,14 +36,14 @@ security-analysis: vendor ## Runs a security analysis with composer
composer audit

.PHONY: static-code-analysis
static-code-analysis: vendor ## Runs a static code analysis with vimeo/psalm
vendor/bin/psalm --config=psalm.xml --clear-cache
vendor/bin/psalm --config=psalm.xml --show-info=false --stats --threads=4
static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan
vendor/bin/phpstan clear-result-cache --configuration=phpstan.neon
vendor/bin/phpstan --configuration=phpstan.neon --memory-limit=-1

.PHONY: static-code-analysis-baseline
static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with vimeo/psalm
vendor/bin/psalm --config=psalm.xml --clear-cache
vendor/bin/psalm --config=psalm.xml --set-baseline=psalm-baseline.xml
static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with phpstan/phpstan
vendor/bin/phpstan clear-result-cache --configuration=phpstan.neon
vendor/bin/phpstan --allow-empty-baseline --configuration=phpstan.neon --generate-baseline=phpstan-baseline.neon --memory-limit=-1

.PHONY: tests
tests: vendor ## Runs unit tests with phpunit/phpunit
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
[![Renew](https://github.com/ergebnis/rector-rules/workflows/Renew/badge.svg)](https://github.com/ergebnis/rector-rules/actions)

[![Code Coverage](https://codecov.io/gh/ergebnis/rector-rules/branch/main/graph/badge.svg)](https://codecov.io/gh/ergebnis/rector-rules)
[![Type Coverage](https://shepherd.dev/github/ergebnis/rector-rules/coverage.svg)](https://shepherd.dev/github/ergebnis/rector-rules)

[![Latest Stable Version](https://poser.pugx.org/ergebnis/rector-rules/v/stable)](https://packagist.org/packages/ergebnis/rector-rules)
[![Total Downloads](https://poser.pugx.org/ergebnis/rector-rules/downloads)](https://packagist.org/packages/ergebnis/rector-rules)
Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"nikic/php-parser": "^4.17.1 || ^5.0.0",
"phpstan/phpstan": "^1.10.36",
"rector/rector": "^1.0.0",
"rector/rector": "^1.0.4",
"symplify/rule-doc-generator-contracts": "^9.3.26"
},
"require-dev": {
Expand All @@ -30,9 +30,11 @@
"ergebnis/php-cs-fixer-config": "^6.37.0",
"ergebnis/phpunit-slow-test-detector": "^2.16.1",
"infection/infection": "~0.26.6",
"phpunit/phpunit": "^9.6.20",
"psalm/plugin-phpunit": "~0.19.0",
"vimeo/psalm": "^5.26.1"
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan-deprecation-rules": "^1.2.1",
"phpstan/phpstan-phpunit": "^1.4.0",
"phpstan/phpstan-strict-rules": "^1.6.1",
"phpunit/phpunit": "^9.6.20"
},
"autoload": {
"psr-4": {
Expand All @@ -48,7 +50,8 @@
"allow-plugins": {
"composer/package-versions-deprecated": true,
"ergebnis/composer-normalize": true,
"infection/extension-installer": true
"infection/extension-installer": true,
"phpstan/extension-installer": true
},
"audit": {
"abandoned": "report"
Expand Down
Loading
Loading