generated from ddev/ddev-addon-template
-
-
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f1e817d
Add phpstan command.
markdorison fa0c497
use env var for docroot
weitzman 31ae6d4
support ddev project-type 'drupal'
jameswilson e33b982
run 'ddev expand-composer-json' so phpstan-drupal can detect drupal root
jameswilson da8fbd6
use phpstan.neon config file from gitlab_templates
jameswilson a606bf2
clean up temporary composer files from expand-composer-json
jameswilson 5c518b9
suggest running 'ddev poser' instead of 'ddev composer install'
jameswilson 3415402
fix error 'rm composer.contrib.lock not found'
jameswilson b8cb5e0
Add empty baseline (#1)
claudiu-cristea 122c25e
Merge branch 'main' into 13-phpstan
markdorison 08eb0e4
Simplify command and add minimal test
weitzman 1a10938
Add link
weitzman ce2f8aa
Remove yarn install from ddev poser. It requires corepack in D11+. No…
weitzman 9009cfa
Add to install files
weitzman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
#ddev-generated | ||
## Command provided by https://github.com/ddev/ddev-drupal-contrib | ||
## Description: Run phpstan inside the web container | ||
## Usage: phpstan [flags] [args] | ||
## Example: "ddev phpstan" or "ddev phpstan -n" | ||
## ProjectTypes: drupal,drupal8,drupal9,drupal10 | ||
## ExecRaw: true | ||
|
||
if ! command -v phpstan >/dev/null; then | ||
echo "phpstan is not available. You may need to 'ddev poser'" | ||
exit 1 | ||
fi | ||
test -e phpstan.neon || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpstan.neon | ||
# Add an empty baseline file to ensure it exists. | ||
test -e phpstan-baseline.neon || touch phpstan-baseline.neon | ||
export COMPOSER=composer.contrib.json | ||
.ddev/commands/web/expand-composer-json "$DDEV_PROJECT_NAME" | ||
phpstan analyse $DDEV_DOCROOT/modules/custom "$@" | ||
rm composer.contrib.json |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.