Skip to content

hussainweb/drupalqa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Static Analysis Tools for Drupal and PHP

Docker Pulls

Docker image providing static analysis tools for Drupal and PHP. This is based on the comprehensive PHPQA image and adds Drupal specific sniffs and PAReview.

Supported platforms and PHP versions

DockerHub repository: https://hub.docker.com/r/hussainweb/drupalqa

This image currently only supports Debian along with 8.0, 8.1, and 8.2. PHP 7.x images are available but no longer supported by the upstream image.

Debian

Available Tools

See PHPQA's available tools for a complete list of tools provided by that image. DrupalQA adds these tools:

NOTE: Drupal coder sniffs requires additional dependencies which aren't loaded when PHPCS is run via PHAR module (as is the case with phpcs provided by the phpqa image). For this reason, we remove the phpcs PHAR file and install it using composer.

Running tools

Pull the image:

docker pull hussainweb/drupalqa:latest

Read additional documentation in phpqa's README.

To run the selected tool inside the container, you'll need to mount the project directory on the container with -v $(pwd):/project. Some tools like to write to the /tmp directory (like PHPStan, or Behat in some cases), therefore it's often useful to share it between docker runs, i.e. with -v $(pwd)/tmp-phpqa:/tmp. If you want to be able to interrupt the selected tool if it takes too much time to complete, you can use the --init option. Please refer to the docker run documentation for more information.

docker run --init -it --rm -v $(pwd):/project -v $(pwd)/tmp-phpqa:/tmp -w /project hussainweb/drupalqa phpstan analyse web/modules/custom

GitHub Action

You can run DrupalQA as part of your GitHub Actions workflow directly using the associate action. Visit the action page readme or the marketplace page to learn more.