### Install Drupal with Configuration Source: https://context7.com/vardot/ddev-dev-tools/llms.txt Command to install Drupal using existing configuration. It automates composer install, database import, updates, configuration import, module uninstallation, and admin user creation. ```bash # Install Drupal using existing configuration ddev install-drupal # The command performs the following steps: # 1. Runs composer install with autoloader optimization # 2. Imports database from ./backups directory # 3. Runs database updates (drush updb) # 4. Imports configuration (drush cim) # 5. Uninstalls captcha, login_destination, honeypot modules # 6. Creates admin user with password "password" # 7. Assigns site_admin role or available admin roles # Example output: # 🛠️ Installing Drupal... # Installing dependencies from composer.json... # 📥 Importing Database... # Multiple database backups found: # 1) ./backups/thin-db.sql.gz # 2) ./backups/full-db.sql.gz # ? Enter selection number: 1 # Importing database... # 📦 Updating Database... # [drush updb output...] # ⚙️ Importing Configuration... # [drush cim output...] # ⚙️ Disabling Captcha & Login destination modules # 👤 Creating site admin user... # ✅ Installation Complete! ``` -------------------------------- ### Cypress with Cucumber BDD Setup and Execution Source: https://context7.com/vardot/ddev-dev-tools/llms.txt This guide explains how to set up and run Cypress tests using Cucumber for Behavior-Driven Development (BDD) within a DDEV environment. It includes commands for installing necessary preprocessor packages, copying configuration files, creating feature files (e.g., `.feature`), and writing step definitions in JavaScript. Finally, it shows how to execute these Cucumber-integrated tests using 'ddev cypress-headless'. ```bash # Install Cucumber preprocessor packages ddev cypress-install # This installs: # - @badeball/cypress-cucumber-preprocessor # - @bahmutov/cypress-esbuild-preprocessor # Copy Cucumber configuration example cp examples/cypress.config.js.example-[cucumber] cypress.config.js # Create feature files in cypress/e2e/ # Example: cypress/e2e/user_authentication.feature cat > cypress/e2e/user_authentication.feature << 'EOF' Feature: User Authentication Scenario: Successful user login Given I visit the login page When I enter username "admin" and password "password" And I click the login button Then I should see the user dashboard And I should see "Welcome, admin" message Scenario: Failed login with invalid credentials Given I visit the login page When I enter username "invalid" and password "wrong" And I click the login button Then I should see an error message And I should remain on the login page EOF # Create step definitions in cypress/e2e/step_definitions/ cat > cypress/e2e/step_definitions/authentication.js << 'EOF' import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'; Given('I visit the login page', () => { cy.visit('/user/login'); }); When('I enter username {string} and password {string}', (username, password) => { cy.get('#edit-name').type(username); cy.get('#edit-pass').type(password); }); When('I click the login button', () => { cy.get('#edit-submit').click(); }); Then('I should see the user dashboard', () => { cy.url().should('include', '/user'); }); Then('I should see {string} message', (message) => { cy.contains(message).should('be.visible'); }); EOF # Run Cucumber tests ddev cypress-headless ``` -------------------------------- ### Install Cucumber Preprocessor and Copy Configuration - Bash Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Installs necessary Cucumber preprocessor packages for Cypress and copies an example Cucumber configuration file. This prepares Cypress for Behavior-Driven Development with Gherkin syntax. ```bash # Install Cucumber preprocessor packages ddev cypress-install # Copy example configuration cp examples/cypress.config.js.example-[cucumber] cypress.config.js ``` -------------------------------- ### Create Pipeline Configuration File - Bash Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Copies an example pipeline configuration file to the project directory. This is the initial step for setting up CI/CD. ```bash cp config.pipeline.yaml.example .ddev/config.pipeline.yaml ``` -------------------------------- ### CI/CD Drupal Installation Source: https://context7.com/vardot/ddev-dev-tools/llms.txt Command for installing Drupal in a CI environment. It automatically uses a specific database backup and skips interactive prompts, making it suitable for automated pipelines. Includes post-installation checks for test content availability. ```bash # In CI environment with IS_CI=TRUE ddev install-drupal # Uses ./backups/thin-db.sql.gz automatically # Skips interactive prompts # Suitable for automated pipelines # After installation, source the module detection status if [ -f .cypress_test_content_status ]; then source .cypress_test_content_status fi if [ "${CYPRESS_TEST_CONTENT_AVAILABLE}" = "true" ]; then echo "Running tests with cypress_test_content module" ddev cypress-headless --spec="cypress/e2e/content-tests.cy.js" else echo "Skipping content tests - module not available" fi ``` -------------------------------- ### Verify DDEV Development Tools Installation Source: https://context7.com/vardot/ddev-dev-tools/llms.txt Verifies that the installed DDEV Development Tools commands are available in the DDEV environment by listing all commands and filtering for those starting with 'dev-'. This confirms the successful installation of linters and testing tools. ```bash # Verify installed commands are available ddev --help | grep dev- ``` -------------------------------- ### Install DDEV Development Tools Add-on Source: https://context7.com/vardot/ddev-dev-tools/llms.txt Installs the DDEV Development Tools add-on using the 'ddev add-on get' command and then restarts DDEV to apply the changes. This automatically configures PHP CodeSniffer, TwigCS Fixer, ESLint, Stylelint, Cypress, and necessary dependencies. ```bash # Add the dev-tools add-on to your DDEV project ddev add-on get Vardot/ddev-dev-tools # Restart DDEV to apply changes ddev restart ``` -------------------------------- ### DDEV Installation and Restart Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Installs the DDEV development tools addon by Vardot and restarts the DDEV environment to apply the changes. ```bash ddev add-on get Vardot/ddev-dev-tools ddev restart ``` -------------------------------- ### Run All Linters with ddev dev-lint Source: https://context7.com/vardot/ddev-dev-tools/llms.txt Commands to run all configured linters (PHP, JS, CSS, Twig, Spell Checking). Supports checking git changed files or all files. Provides example output of the linting process. ```bash # Run all linters on git changed files ddev dev-lint # Example output: # 🔍 Running linters... # 🖥 Running locally # 🔍 Using git diff... # ➡ PHP Linting... # ✅ No files to check # ➡ JS Linting... # Files to check: # web/themes/custom/example/js/custom.js # [ESLint results...] # ➡ CSS Linting... # ✅ No CSS files to check # ➡ Twig Linting... # ✅ No Twig files to check # ➡ Spell Checking... # Files to check: # README.md # [CSpell results...] # ✅ All linting completed successfully! # Run all linters on all files (comprehensive check) ddev dev-lint-all # This is equivalent to running: # ddev dev-phpcs --all # ddev dev-eslint --all # ddev dev-stylelint --all # ddev dev-twigcs --all # ddev dev-cspell --all ``` -------------------------------- ### Configure Display Settings for Cypress - macOS Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Sets up the display environment for running Cypress on macOS. It involves installing XQuartz, configuring its preferences, and adjusting the host's access control to allow Docker container connections. ```bash brew install xquartz --cask open -a XQuartz # Check "Allow connections from network clients" in XQuartz preferences # Restart your Mac xhost + 127.0.0.1 # Add to .ddev/docker-compose.cypress_extra.yaml: services: cypress: environment: - DISPLAY=host.docker.internal:0 ``` -------------------------------- ### Install Drupal with Cypress Test Content Detection Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Installs Drupal and automatically detects the presence of the 'cypress_test_content' module. It sets the CYPRESS_TEST_CONTENT_AVAILABLE environment variable accordingly, which can be used in test scripts or CI/CD pipelines to conditionally run tests. ```bash # After running ddev install-drupal, source the status file if [ -f .cypress_test_content_status ]; then source .cypress_test_content_status fi if [ "${CYPRESS_TEST_CONTENT_AVAILABLE}" = "true" ]; then echo "Running tests with cypress_test_content module" ddev cypress-headless --spec="cypress/e2e/content-tests.cy.js" else echo "Skipping content tests - cypress_test_content module not available" fi ``` -------------------------------- ### Configure Cypress Display for macOS and Linux Source: https://context7.com/vardot/ddev-dev-tools/llms.txt This snippet details the steps to configure the display settings for running Cypress tests within a DDEV environment. It includes instructions for both macOS and Linux users, covering package installations, environment variable exports, and host access control to enable the Cypress GUI to connect to the Docker container. ```bash # macOS setup brew install xquartz --cask open -a XQuartz # Enable "Allow connections from network clients" in preferences # Restart Mac xhost + 127.0.0.1 # Create display configuration cat > .ddev/docker-compose.cypress_extra.yaml << 'EOF' services: cypress: environment: - DISPLAY=host.docker.internal:0 EOF ddev restart # Linux setup export DISPLAY=:0 xhost + ddev cypress-ui ``` -------------------------------- ### Custom PHP Code Sniffer Extensions and Path Detection Source: https://context7.com/vardot/ddev-dev-tools/llms.txt This example demonstrates how to configure `ddev dev-phpcs` to scan files with custom extensions beyond the default PHP files. It also shows how to create a custom DDEV command (`custom-check`) that utilizes utility functions like `get_docroot` and `get_files` from `dev-utils.sh` to identify and process changed PHP and module files, as well as all Twig files within the project. ```bash # Check PHP files with custom extensions ddev dev-phpcs --ext=php,module,inc,install,profile,theme # Use dev-utils.sh functions in custom scripts cat > .ddev/commands/web/custom-check << 'EOF' #!/bin/bash source "${0%/*}/dev-utils.sh" # Get document root (detects web/ or docroot/) DOCROOT=$(get_docroot) echo "Using document root: $DOCROOT" # Get changed PHP and module files FILES=$(get_files "php" "module") echo "Changed files: $FILES" # Get all Twig files ALL_TWIG=$(get_all_files "twig") echo "All Twig files: $ALL_TWIG" EOF chmod +x .ddev/commands/web/custom-check ddev custom-check ``` -------------------------------- ### GitHub Actions Linting Workflow with DDEV Source: https://context7.com/vardot/ddev-dev-tools/llms.txt This YAML workflow file defines a GitHub Actions job to lint code within a DDEV environment. It checks out the code, identifies changed files in PHP, JS, and CSS, sets up DDEV, installs dev-tools, and runs the 'ddev dev-lint' command. It prepares a pipeline configuration file with environment variables indicating changed files. ```yaml # .github/workflows/lint.yml name: Lint Code on: pull_request: branches: [main, develop] jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Get changed files id: changed-files run: | echo "PHP_CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -E '(docroot|web)/(modules|themes)/custom/.*.(php|module)$' | tr '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV echo "JS_CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -E '(docroot|web)/(modules|themes)/custom/.*.(js)$' | tr '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV echo "STYLE_CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -E '(docroot|web)/(modules|themes)/custom/.*.(css)$' | tr '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV - name: Setup DDEV run: | curl -fsSL https://apt.fury.io/drud/gpg.key | sudo apt-key add - echo "deb https://apt.fury.io/drud/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list sudo apt update && sudo apt install -y ddev - name: Start DDEV run: ddev start - name: Install dev-tools run: | ddev add-on get Vardot/ddev-dev-tools ddev restart - name: Create pipeline config run: | cat > .ddev/config.pipeline.yaml << EOF web_environment: - IS_CI=TRUE - PHP_CHANGED_FILES=${{ env.PHP_CHANGED_FILES }} - JS_CHANGED_FILES=${{ env.JS_CHANGED_FILES }} - STYLE_CHANGED_FILES=${{ env.STYLE_CHANGED_FILES }} EOF - name: Run linting run: ddev dev-lint ``` -------------------------------- ### Check Spelling with CSpell Source: https://context7.com/vardot/ddev-dev-tools/llms.txt Commands to check spelling in project files using CSpell. Supports checking changed files, all files, or specific files. Provides example output highlighting detected spelling errors. ```bash # Check spelling in changed text files ddev dev-cspell # Check spelling in all files ddev dev-cspell --all # Check specific files ddev dev-cspell --files=README.md,web/modules/custom/mymodule/mymodule.module # Example output: # Files to check: # README.md # web/modules/custom/example/src/Controller/ExampleController.php # # README.md:12:45 - Unknown word (implimentation) # ExampleController.php:23:12 - Unknown word (retreive) # # ❌ 2 spelling issues found ``` -------------------------------- ### Basic Cypress Testing Commands Source: https://context7.com/vardot/ddev-dev-tools/llms.txt This section details essential bash commands for running Cypress tests within a DDEV environment. It covers opening the interactive UI, running tests in headless mode, specifying a particular test spec file, and selecting a browser for execution. The commands leverage the 'ddev cypress' utility. ```bash # Open Cypress interactive UI (requires X11 display) ddev cypress-ui # Run Cypress tests in headless mode ddev cypress-headless # Run specific test spec ddev cypress-headless --spec="cypress/e2e/login.cy.js" # Run with specific browser ddev cypress-headless --browser chrome ``` -------------------------------- ### Configure CI Environment Variables for Linting Source: https://context7.com/vardot/ddev-dev-tools/llms.txt Bash script to capture changed files across different languages (PHP, JS, CSS, Twig, Text) in a Git diff for CI environments like BitBucket Pipelines. It then creates a `config.pipeline.yaml` file with these variables and runs linting. ```bash # BitBucket Pipelines: Set changed files as environment variables PHP_CHANGED_FILES=$(git diff --name-only --diff-filter=dr origin/$BITBUCKET_PR_DESTINATION_BRANCH...$BITBUCKET_BRANCH | grep -E '(docroot|web)/(modules|themes)/custom/.*\.(php|module)$' | tr '\n' ' ') JS_CHANGED_FILES=$(git diff --name-only --diff-filter=dr origin/$BITBUCKET_PR_DESTINATION_BRANCH...$BITBUCKET_BRANCH | grep -E '(docroot|web)/(modules|themes)/custom/.*\.(js)$' | tr '\n' ' ') STYLE_CHANGED_FILES=$(git diff --name-only --diff-filter=dr origin/$BITBUCKET_PR_DESTINATION_BRANCH...$BITBUCKET_BRANCH | grep -E '(docroot|web)/(modules|themes)/custom/.*\.(css)$' | tr '\n' ' ') TWIG_CHANGED_FILES=$(git diff --name-only --diff-filter=dr origin/$BITBUCKET_PR_DESTINATION_BRANCH...$BITBUCKET_BRANCH | grep -E '(docroot|web)/(modules|themes)/custom/.*\.(twig)$' | tr '\n' ' ') TEXT_CHANGED_FILES=$(git diff --name-only --diff-filter=dr origin/$BITBUCKET_PR_DESTINATION_BRANCH...$BITBUCKET_BRANCH | grep -E '(docroot|web)/(modules)/custom/.*\.(php|module|js|twig|yml|yaml|json|css|scss|sass|md|txt)$' | tr '\n' ' ') # Create pipeline configuration file cat > .ddev/config.pipeline.yaml << EOF web_environment: - IS_CI=TRUE - PHP_CHANGED_FILES=$PHP_CHANGED_FILES - JS_CHANGED_FILES=$JS_CHANGED_FILES - STYLE_CHANGED_FILES=$STYLE_CHANGED_FILES - TWIG_CHANGED_FILES=$TWIG_CHANGED_FILES - TEXT_CHANGED_FILES=$TEXT_CHANGED_FILES EOF # Run linting in CI environment ddev dev-lint # Example CI output: # 🔍 Running linters... # 📋 Running in CI environment - using predefined changed files # ➡ PHP Linting... # web/modules/custom/example/src/Controller/ExampleController.php # web/modules/custom/example/example.module ``` -------------------------------- ### Run Stylelint for CSS/SCSS Linting Source: https://context7.com/vardot/ddev-dev-tools/llms.txt Executes Stylelint to lint CSS and SCSS files. It can check files present in the git diff, all CSS files within custom modules and themes, or specific CSS files as required. ```bash # Check CSS files in git diff ddev dev-stylelint # Check all CSS files in custom modules and themes ddev dev-stylelint --all # Check specific CSS files ddev dev-stylelint --files=web/themes/custom/mytheme/css/style.css,web/themes/custom/mytheme/css/layout.css ``` -------------------------------- ### Integrate Pre-commit Hook for Code Quality Checks Source: https://context7.com/vardot/ddev-dev-tools/llms.txt This section provides a bash script to set up a Git pre-commit hook. When a commit is attempted, this hook automatically runs `ddev dev-lint` to check the staged files for code quality issues. If linting fails, the commit is aborted, ensuring that only code adhering to standards is committed. It includes instructions on creating the hook file and making it executable. ```bash # Create Git pre-commit hook cat > .git/hooks/pre-commit << 'EOF' #!/bin/bash echo "Running code quality checks..." # Run linting on staged files if ! ddev dev-lint; then echo "❌ Linting failed. Commit aborted." echo "Fix the issues or use 'git commit --no-verify' to skip checks." exit 1 fi echo "✅ All checks passed!" exit 0 EOF chmod +x .git/hooks/pre-commit ``` -------------------------------- ### Run Individual Linting Tools on Changed Files (Default) Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Executes individual linting tools on files that have been changed in the Git repository. This is the default behavior for these commands. ```bash ddev dev-phpcs # Check PHP files in git diff ddev dev-eslint # Check JS files in git diff ddev dev-stylelint # Check CSS files in git diff ddev dev-twigcs # Check Twig files in git diff ddev dev-cspell # Check text files in git diff ``` -------------------------------- ### CI/CD Module Detection and Cypress Test Execution - Bash Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md This script demonstrates how to detect Drupal modules using 'ddev install-drupal', source the results, and conditionally run Cypress tests based on test content availability. It ensures Cypress tests are only executed when test content is present. ```bash # Run Drupal installation which detects the module ddev install-drupal # Source the module detection result if [ -f .cypress_test_content_status ]; then source .cypress_test_content_status fi # Use the environment variable if [ "${CYPRESS_TEST_CONTENT_AVAILABLE}" = "true" ]; then echo "Running Cypress tests with test content" ddev cypress-headless else echo "Skipping Cypress tests - no test content module" fi ``` -------------------------------- ### Run Individual Linting Tools on All Files Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Executes linting tools on all files within the project. This is useful for a comprehensive code quality check across the entire codebase. ```bash ddev dev-phpcs --all # Check all PHP files ddev dev-eslint --all # Check all JS files ddev dev-stylelint --all # Check all CSS files ddev dev-twigcs --all # Check all Twig files ddev dev-cspell --all # Check all text files ``` -------------------------------- ### Run Individual Linting Tools on Specific Files Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Runs specified linting tools on a comma-separated list of files. This allows for targeted linting of specific files or directories. ```bash ddev dev-phpcs --files=path/to/file1.php,path/to/file2.module ddev dev-eslint --files=path/to/file1.js,path/to/file2.js ddev dev-stylelint --files=path/to/file1.css,path/to/file2.css ddev dev-twigcs --files=path/to/file1.twig,path/to/file2.twig ddev dev-cspell --files=path/to/file1.txt,path/to/file2.md ``` -------------------------------- ### Configure Display Settings for Cypress - Linux Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Configures the display environment for running Cypress on Linux. It exports the DISPLAY variable and allows connections from any host. ```bash export DISPLAY=:0 xhost + ``` -------------------------------- ### Run Combined Linting Commands Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Combines multiple linting operations into single commands. 'dev-lint' runs all linters on changed files, while 'dev-lint-all' runs them on all files in the project. ```bash ddev dev-lint # Run all linters on git changes ddev dev-lint-all # Run all linters on all files ``` -------------------------------- ### Generate CI/CD Pipeline Configuration - GitHub Actions Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Dynamically generates the '.ddev/config.pipeline.yaml' file within a GitHub Actions workflow. It utilizes environment variables for changed files and CI status. ```yaml jobs: lint: steps: - run: | cat > .ddev/config.pipeline.yaml << EOF web_environment: - IS_CI=TRUE - PHP_CHANGED_FILES=${{ env.PHP_CHANGED_FILES }} - JS_CHANGED_FILES=${{ env.JS_CHANGED_FILES }} - STYLE_CHANGED_FILES=${{ env.STYLE_CHANGED_FILES }} - TWIG_CHANGED_FILES=${{ env.TWIG_CHANGED_FILES }} - TEXT_CHANGED_FILES=${{ env.TEXT_CHANGED_FILES }} EOF ``` -------------------------------- ### Run ESLint for JavaScript Linting Source: https://context7.com/vardot/ddev-dev-tools/llms.txt Executes ESLint to lint JavaScript files based on Drupal core's `.eslintrc.json` configuration. It can check files included in the git diff, all JavaScript files, or specific files. A local `.eslintrc.json` in the project root takes precedence. ```bash # Check JavaScript files in git diff ddev dev-eslint # Check all JavaScript files ddev dev-eslint --all # Check specific JavaScript files ddev dev-eslint --files=web/themes/custom/mytheme/js/script.js,web/modules/custom/mymodule/js/behavior.js ``` -------------------------------- ### Generate CI/CD Pipeline Configuration - BitBucket Pipelines Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Dynamically generates the '.ddev/config.pipeline.yaml' file within a BitBucket pipeline script. It sets environment variables for changed files and CI status. ```yaml steps: - step: script: - | cat > .ddev/config.pipeline.yaml << EOF web_environment: - IS_CI=TRUE - PHP_CHANGED_FILES=${PHP_CHANGED_FILES} - JS_CHANGED_FILES=${JS_CHANGED_FILES} - STYLE_CHANGED_FILES=${STYLE_CHANGED_FILES} - TWIG_CHANGED_FILES=${TWIG_CHANGED_FILES} - TEXT_CHANGED_FILES=${TEXT_CHANGED_FILES} EOF ``` -------------------------------- ### Run Linting Command - Bash Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Executes the DDEV dev-lint command to perform linting operations on the project. This command is typically run after the pipeline configuration is set up. ```bash ddev dev-lint ``` -------------------------------- ### CI/CD Environment Variables for Linting and Test Content Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Defines environment variables to configure CI/CD pipelines for running linters and managing test content availability. These variables can be set in CI environments to control the linting process and test execution. ```bash IS_CI=TRUE PHP_CHANGED_FILES="file1.php,file2.module" JS_CHANGED_FILES="file1.js,file2.js" STYLE_CHANGED_FILES="file1.css,file2.css" TWIG_CHANGED_FILES="file1.twig,file2.twig" TEXT_CHANGED_FILES="file1.md,file2.txt" CYPRESS_TEST_CONTENT_AVAILABLE="true" # Set automatically by install-drupal command based on filesystem detection ``` -------------------------------- ### Specify PHP_CodeSniffer File Extensions Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Allows customization of the file extensions that PHP_CodeSniffer will check. This is useful for projects with non-standard file naming conventions. ```bash # Check specific file extensions ddev dev-phpcs --ext=php,module,inc ``` -------------------------------- ### Run PHP CodeSniffer for Drupal Standards Source: https://context7.com/vardot/ddev-dev-tools/llms.txt Executes PHP CodeSniffer to check PHP files against Drupal and DrupalPractice coding standards. It supports checking files in git diff (default), all files, or specific files, and allows customization of file extensions. ```bash # Check PHP files changed in git diff (default mode) ddev dev-phpcs # Check all PHP files in custom modules and themes ddev dev-phpcs --all # Check specific files ddev dev-phpcs --files=web/modules/custom/mymodule/src/Controller/MyController.php,web/modules/custom/mymodule/mymodule.module # Specify custom file extensions to check ddev dev-phpcs --ext=php,module,inc,install ``` -------------------------------- ### Generate CI/CD Pipeline Configuration - Azure DevOps Source: https://github.com/vardot/ddev-dev-tools/blob/main/README.md Dynamically generates the '.ddev/config.pipeline.yaml' file within an Azure DevOps pipeline script. It uses predefined variables for changed files and CI status. ```yaml steps: - bash: | cat > .ddev/config.pipeline.yaml << EOF web_environment: - IS_CI=TRUE - PHP_CHANGED_FILES=$(PHP_CHANGED_FILES) - JS_CHANGED_FILES=$(JS_CHANGED_FILES) - STYLE_CHANGED_FILES=$(STYLE_CHANGED_FILES) - TWIG_CHANGED_FILES=$(TWIG_CHANGED_FILES) - TEXT_CHANGED_FILES=$(TEXT_CHANGED_FILES) EOF ``` -------------------------------- ### Run TwigCS Fixer for Twig Template Linting Source: https://context7.com/vardot/ddev-dev-tools/llms.txt Executes TwigCS Fixer to lint Twig template files. This command can check Twig files modified in the git diff, all Twig templates within the project, or a specified list of individual Twig files. ```bash # Check Twig files in git diff ddev dev-twigcs # Check all Twig templates ddev dev-twigcs --all # Check specific Twig files ddev dev-twigcs --files=web/themes/custom/mytheme/templates/page.html.twig,web/modules/custom/mymodule/templates/block.html.twig ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.