-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add phpstan command. #14
Conversation
I am currently getting the following error when I attempt to run the command. 🤔
|
It might be because drupalfinder can't find Drupal. Drush no longer uses drupalfinder as it has not had a release in like 5 years. Composer can now find Drupal root. I'll talk to mgalalm |
You can work around this by setting up the
|
Will be fixed by webflo/drupal-finder#64 if that gets merged |
|
Would be also nice to add an example in README how to create a PHPStan baseline file for your contrib module via this DDEV phpstan command to help module maintainers and contributors with it :) |
From above on this issue:
That got merged 2 weeks ago, but I'm still seeing issues with the current PR as it is coded. But there is good news. While looking into this, I stumbled across this key information:
Originally posted by @gardon in #42 (comment), closed as a dupe of this issue If I copy the first two lines from .ddev/commands/web/poser into .ddev/commands/web/phpstan, it works! These lines:
The full contents of .ddev/commands/web/phpstan:
I guess I don't have permission to update a PR from someone else. (I miss the "Get Push Access" we have on Drupal MRs here). |
So Fixed by pulling in phpstan.neon file from gitlab_templates project: Updated working command:
|
I created a new PR #53 building on the work here following methodology from https://stackoverflow.com/a/39807499/413538. I fixed merge conflicts and created separate commits for the different pieces I've mentioned above in previous comments. |
This was merged, and released in 1.3.0 |
Closing then, thanks. |
@rfay webflo/drupal-finder#64 was blocking this but doesn't replace it (AFAIK), unless you are closing it to go with #53? |
OK then :) |
If you want to continue with it, please rebase and solve the conflicts. |
Co-authored-by: hussainweb <hussainweb@gmail.com>
Rebased |
With the current state of the PR I'm getting:
The problem is here https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.main.yml#L516 I've created markdorison#1 to improve the current PR |
lets add a line to the tests so that we know it doesnt error. |
commands/web/phpstan
Outdated
export COMPOSER=composer.contrib.json | ||
.ddev/commands/web/expand-composer-json "$DDEV_PROJECT_NAME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command should assume that composer has already been run. Thats how phpunit command works, for example. So we can remove these lines.
…t wirth cross version complexity
The Issue
Adds support for
phpstan
command to more closely mimic GitLab CI configuration/runs.How This PR Solves The Issue
Manual Testing Instructions
ddev phpstan
Automated Testing Overview
N/A
Related Issue Link(s)
Closes #13
Release/Deployment Notes
N/A