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

Use phpstan-drupal for code analysis #134

Merged
merged 12 commits into from
Feb 14, 2023
4 changes: 2 additions & 2 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ jobs:
run: |
# Using `--no-scripts` breaks something with mglaman/drupal-check.
composer install --no-interaction --no-progress --no-scripts
- name: drupal-check
- name: code-analysis
run: |
composer code-analysis/drupal-check
composer code-analysis

coding-standards-custom-themes:
name: Yarn - Check Coding Standards in custom themes
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Nedenfor ses dato for release og beskrivelse af opgaver som er implementeret.

* Installerede [OS2Forms organisation
1.0.0](https://github.com/itk-dev/os2forms_organisation/releases/tag/1.0.0).
* Phpstan config

### Opdateret

Expand Down
15 changes: 9 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@
"require-dev": {
"drupal/core-dev": "^9.1",
"drupal/mail_debugger": "^1.4",
"mglaman/drupal-check": "^1.3"
"mglaman/phpstan-drupal": "^1.1",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-deprecation-rules": "^1.1"
},
"conflict": {
"drupal/drupal": "*"
Expand All @@ -99,7 +102,8 @@
"composer/installers": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
}
},
"extra": {
Expand Down Expand Up @@ -190,11 +194,11 @@
"install-codestandards": [
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
],
"code-analysis/drupal-check": [
"vendor/bin/drupal-check --deprecations --analysis web/modules/custom"
"code-analysis/phpstan": [
"vendor/bin/phpstan analyse"
],
"code-analysis": [
"@code-analysis/drupal-check"
"@code-analysis/phpstan"
],
"coding-standards-check/phpcs": [
"vendor/bin/phpcs --standard=phpcs.xml.dist"
Expand All @@ -208,6 +212,5 @@
"coding-standards-apply": [
"@coding-standards-apply/phpcs"
]

}
}
Loading