phpcs and phpcbf are readily available in the cli container. Both Drupal Coding Standards and WordPress Coding Standards
have been installed and are ready to use.
We have converted this into a Docksal Addon which can be installed running the addon subcommand.
fin addon install phpcs
This will enable the following to run:
# Running PHPCS
fin phpcs cs docroot/sites/all/modules/custom
# Running PHPCBF
fin phpcs cbf docroot/sites/all/modules/custom
Instead of installing an addon, you can use phpcs/phpcbf directly every time.
The following commands below can be run anywhere from within your project’s folder:
fin run phpcs \
--standards="Drupal,DrupalPractice" -n \
--extensions="php,module,inc,install,test,profile,theme" \
--ignore="*.features.*,*.pages*.inc" \
docroot/sites/all/modules/custom
fin run phpcbf \
--standards="Drupal,DrupalPractice" -n \
--extensions="php,module,inc,install,test,profile,theme" \
--ignore="*.features.*,*.pages*.inc" \
docroot/sites/all/modules/custom
fin run phpcs \
--standards="WordPress" -n \
docroot/wp-content/plugin
fin run phpcbf \
--standards="WordPress" -n \
docroot/wp-content/plugins