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

Make Code Quality aware of DDEV #393

Open
hkirsman opened this issue Feb 23, 2024 · 0 comments
Open

Make Code Quality aware of DDEV #393

hkirsman opened this issue Feb 23, 2024 · 0 comments

Comments

@hkirsman
Copy link
Contributor

hkirsman commented Feb 23, 2024

If you install DDEV to this project and try to commit, Code Quality tool (GrumPHP) will start Lando instead because we have this in code:

  git_hook_variables:
    EXEC_GRUMPHP_COMMAND: lando php

Either we keep this as is as Lando can handle starting up only the the needed containers on demand, or we add some logic to decide what to run.

Unfortunately we're quite limited on writing some advanced code here but I've come up with this logic:

  1. We assume our projects can have both Lando and DDEV setups for now.
  2. We assume developer uses either Lando or DDEV, but not both. So this means every developer has the project set up with either Lando or DDEV only.
  3. So based on these assumptions, DDEV creates different folders under .ddev if it has been started. These are not there if you clone the project. So the trick is to check if .ddev/traefik/ folder exists and if so then start Code Quality with DDEV, if not then with Lando.
grumphp:
  git_hook_variables:
    EXEC_GRUMPHP_COMMAND:  "[ -d .ddev/traefik/ ] && GRUMPHP_COMMAND='ddev php' || GRUMPHP_COMMAND='lando php' && $GRUMPHP_COMMAND"

On existing projects this needs to be run:
ddev grumphp git:init

Wondering also if I should instead create some automatic update to wunderio/ddev-drupal package.

@hkirsman hkirsman changed the title Make Code Quality DDEV aware Make Code Quality aware of DDEV Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant