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

#47 Streamline development process, fix phpstan. #48

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
17 changes: 10 additions & 7 deletions .lando/build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ proj="$app/drupal"
webroot="$proj/web"
sites="$webroot/sites"
default="$sites/default"
pingroot="$app/drupal-ping"

set +e
rm -rf "$proj"
Expand All @@ -26,12 +25,16 @@ composer create-project drupal/recommended-project "$proj"

chmod 755 "$default"
rm -f "$default/settings.php"
ln -s "$pingroot/settings.php" "$default/"
ln -s "$pingroot/_ping.custom.php" "$webroot/"
ln -s "$pingroot/_ping.php" "$webroot/"
chmod 644 "$pingroot/settings.php"
ln -s "$app/settings.php" "$default/"
ln -s "$app/_ping.custom.php" "$webroot/"
ln -s "$app/_ping.php" "$webroot/"
chmod 644 "$app/settings.php"

cd "$proj"
composer require --dev drush/drush
composer require 'wunderio/code-quality:^2' --dev
composer require 'phpunit/phpunit:^9' --dev
# @todo: Lock Code Quality atm because phpstan is failing.
# It's related to installing https://github.com/phpstan/extension-installer in Code Quality 2.4.0. Because it now loads
# phpstan extensions automatically, it starts do more scans with extensions like like mglaman/phpstan-drupal and
# phpstan/phpstan-deprecation-rules.
composer require 'wunderio/code-quality:2.3.0' --dev
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locking to 2.3.0 that does not install https://github.com/phpstan/extension-installer

composer require 'phpunit/phpunit:^9' --dev
2 changes: 1 addition & 1 deletion .lando/cmd-scan
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ set -x
php -l _ping.php
phpcs -sp --report=full --runtime-set testVersion 7.4 --standard=Drupal,DrupalPractice,Security,PHPCompatibility,VariableAnalysis,WunderDrupal,WunderSecurity _ping.php
phpstan analyze --level=5 -- _ping.php
psalm --config=/app/drupal-ping/psalm.xml
psalm --config=/app/psalm.xml
2 changes: 1 addition & 1 deletion .lando/cmd-test
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ cd /app/drupal

set -x

php -d memory_limit=-1 /app/drupal/vendor/bin/phpunit /app/drupal-ping/tests
php -d memory_limit=-1 /app/drupal/vendor/bin/phpunit /app/tests
26 changes: 7 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,25 +173,13 @@ If earlier fails (is empty), then next one is tried.

### Setting up development environment

1. Clone development and testing environment
* `git clone [email protected]:wunderio/drupal-project.git ~/projects/drupal-ping`
* Yes, save it as `drupal-ping`.
1. `cd drupal-ping/`
1. Clone the ping project itself
* `git clone [email protected]:wunderio/drupal-ping.git`
* Yes, save it as `drupal-ping` too, inside the folder of the same name. It is the actual repo we are going to work with.
* Checkout or create your development branch.
1. Link `.lando.yml`
* `rm -f .lando.yml` - at the top-level folder, remove the Lando conf file.
* `ln drupal-ping/.lando.yml` - link the Lando conf from the ping repo folder. Don't create this as a soft (`-s`) link because Lando would mount the project where the original file is. Therefore create the hard link which is indistinguishable for Lando.
1. Link `.lando/`
* `rm -rf .lando` - at the top-level folder, remove the Lando folder.
* `ln -s drupal-ping/.lando` - link the Lando scripts folder from the ping repo folder.
1. `lando start`
1. Note that the Drupal install will mess up `settings.php` a bit, don't commit.
1. https://ping.lndo.site/_ping.php
1. `lando scan`
1. `lando test`
1. Clone the ping project and cd into it
`git clone [email protected]:wunderio/drupal-ping.git`
2. Change into the drupal-ping folder `cd drupal-ping/`
3. Checkout or create your development branch.
4. Start Lando `lando start`
5. Note that the Drupal install will mess up `settings.php` a bit, don't commit.
6. https://ping.lndo.site/_ping.php

### Development commands

Expand Down