drupal fix - PauloCarv/drupalclaw-project GitHub Wiki
drupal-fix
Auto-fix coding standard violations in your custom code using PHPCBF (PHP Code Beautifier and Fixer).
Usage
/drupal-fix
/drupal-fix path=web/modules/custom/my_module
What it fixes
PHPCBF can automatically correct a subset of PHPCS violations:
- Indentation (tabs → 2 spaces)
- Trailing whitespace
- Missing blank lines between methods
- Brace placement
- Spacing around operators and keywords
- Doc comment formatting (some cases)
Issues that require human judgement (logic errors, naming, PHPStan findings) are reported but not modified.
Scope
By default fixes:
web/modules/custom/
web/themes/custom/
Pass path= to target a specific directory.
Workflow
The recommended workflow is:
/drupal-analyze— see all issues/drupal-fix— auto-fix what's fixable/drupal-analyzeagain — review what remains- Fix remaining issues manually or ask the agent for help
Prerequisites
Requires drupal/coder to be installed:
composer require --dev drupal/coder
Related skills
- drupal-analyze — full analysis before and after fixing