Sign inSign up

pathtoproject/phpcs-drupal

By pathtoproject

•Updated about 1 year ago

Tiny Alpine-based dockerized version of Squiz Labs PHP_CodeSniffer (v3.8.1) for Drupal projects

Image
10

50K+

pathtoproject/phpcs-drupal repository overview

⁠Docker image for phpcs and phpcbf

Tiny version of phpcs with checks your Drupal code against coding standards⁠ and other best practices. It can also fix coding standard violations for you with thephpcbf command from PHP_CodeSniffer⁠.

⁠Available Docker image versions

Docker tagPHPPHP_CodeSnifferDrupal coderBadges
latest8.23.8.18.3.22

⁠Docker mounts

The working directory inside the Docker container is /tmp and should be mounted locally to the root of your project.

⁠Additional tools

palantirnet/drupal-rector v0.19.1
slevomat/coding-standard v8.14.1
mglaman/drupal-check:1.4.0
phpstan/phpstan v1.10.55
phpstan/phpstan-strict-rules:1.5.2

⁠Usage

⁠Shell
$ docker run --rm -v $(pwd):/tmp pathtoproject/phpcs-drupal phpcs
$ docker run --rm -v $(pwd):/tmp pathtoproject/phpcs-drupal phpcbf
⁠Atlassian Bitbucket Cloud⁠
⁠bitbucket-pipelines.yml
definitions:
  steps:
    - step: &phpcs
        name: PHP CodeSniffer
        image: pathtoproject/phpcs-drupal
        script:
          - phpcs

pipelines:
  branches:
    feature/*:
      - step: *phpcs
⁠Lando⁠
⁠.lando.yml
services:
# < v3.20.3
  phpcs:
    type: compose
    services:
      image: pathtoproject/phpcs-drupal:latest
      command: tail -f /dev/null

# >= v3.20.3
  phpcs:
    api: 4
    image: pathtoproject/phpcs-drupal:latest
    command: tail -f /dev/null
    volumes:
      - ./:/app

tooling:
  phpcs:
    service: phpcs
    description: 'Run PHPCS'
    cmd:
      - phpcs 

  phpcbf:
    service: phpcs
    description: 'Run PHPCBF'
    cmd:
      - phpcbf

Tag summary

Content type

Image

Digest

sha256:30060d89f…

Size

21 MB

Last updated

about 1 year ago

docker pull pathtoproject/phpcs-drupal