Open codebymikey opened 3 months ago
Open the branch in Web Editor • VS Code • Insiders
Open Preview
This update introduces new scripts and modifications to existing ones to improve the handling of PHP_CodeSniffer tools (phpcs
and phpcbf
) and PHPUnit within a DDEV environment. The changes streamline the setup and execution of these tools, ensuring compatibility with IDEs and enhancing the developer experience in Gitpod and DDEV setups.
File/Path | Change Summary |
---|---|
.ddev/commands/web/phpcbf |
Added a script to run PHP_CodeSniffer's code beautifier (phpcbf ) within DDEV. |
.ddev/commands/web/phpcs |
Introduced a script to run PHP_CodeSniffer's codesniffer tool (phpcs ) within DDEV. |
.ddev/commands/host/exec_dir |
Modified argument handling and path references based on environment variables. |
.gitpod/drupal/drupalpod-setup/drupalpod-setup.sh |
Updated phpcs configuration check and setup logic. |
.gitpod/utils/env-setup.sh |
Added commands to run PHPUnit, PHPCS, and PHPCBF inside a DDEV container. |
.gitpod/utils/script-templates/ddev-phpcbf.template.sh |
Added a template script for running phpcbf in a DDEV environment. |
.gitpod/utils/script-templates/ddev-phpcs.template.sh |
Introduced a template script for running phpcs in a DDEV environment. |
.gitpod/utils/script-templates/ddev-phpunit.template.sh |
Added a template script for running PHPUnit in a DDEV environment. |
In the realm of code so neat,
Tools align for a developer's feat.
Withphpcs
andphpcbf
at hand,
DDEV and Gitpod make a stand.
Paths and scripts, all set right,
Bringing joy to coders' sight.
🐰✨ CodeRabbit's delight!
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
The Problem/Issue/Bug
Codesniffer integration is currently not the best, so added tooling as well as ensure that the
installed_paths
set bydealerdirect/phpcodesniffer-composer-installer
isn't unintentionally purged after composer has finished installing the site.How this PR Solves The Problem
Add tooling for php codesniffer's
phpcs
andphpcbf
scripts - which are useful for ensuring code meets certain standards (and will help with gitpod integrations like PHPStorm, which require the scripts to be present on the "host").Also ensure that
ddev phpcs --config-set installed_paths vendor/drupal/coder/coder_sniffer
is no longer accidentally overwritten with our script. I'd probably opt to remove this part of the code in the first place if possible if we already have the composer plugin.Manual Testing Instructions
phpcs
andphpcbf
commands should now work with or without theddev
prefix.Related Issue Link(s)
Release/Deployment notes
Summary by CodeRabbit
New Features
Improvements