-
Notifications
You must be signed in to change notification settings - Fork 0
drupal fix
Paulo Maia Carvalho edited this page May 20, 2026
·
1 revision
Auto-fix coding standard violations in your custom code using PHPCBF (PHP Code Beautifier and Fixer).
/drupal-fix
/drupal-fix path=web/modules/custom/my_module
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.
By default fixes:
web/modules/custom/
web/themes/custom/
Pass path= to target a specific directory.
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
Requires drupal/coder to be installed:
composer require --dev drupal/coder- drupal-analyze — full analysis before and after fixing