Image with Code Quality Tools (phpcs, phpcbf, yaml-lint) based on drupal/coder project
1.9K
This project provides a Docker image that includes:
docker pull drakemazzy/ddk-coder:latest
Basic usage:
docker run --rm -v $(pwd):/tmp drakemazzy/ddk-coder:latest phpcs /tmp
With custom configuration:
docker run --rm -v $(pwd):/tmp -v $(pwd)/phpcs.xml:/opt/coder/phpcs.xml drakemazzy/ddk-coder:latest phpcs /tmp
docker run --rm drakemazzy/ddk-coder:latest phpcs --version
docker run --rm drakemazzy/ddk-coder:latest phpcbf --version
Add this to your bitbucket-pipelines.yml:
pipelines:
default:
- step:
image: drakemazzy/ddk-coder:latest
name: Code Quality
script:
- phpcs --standard=/opt/coder/phpcs.xml ./src
With custom configuration:
pipelines:
default:
- step:
image: drakemazzy/ddk-coder:latest
name: Code Quality
artifacts:
- phpcs.xml
script:
- cp ./build/phpcs.xml /opt/coder/phpcs.xml
- phpcs ./src
composer require --dev phpro/grumphp
grumphp.yml):grumphp:
tasks:
phpcs:
standard: /opt/coder/phpcs.xml
triggered_by: [php]
whitelist_patterns:
- /^src\/(.*)/
- /^tests\/(.*)/
docker:
image: drakemazzy/ddk-coder:latest
workdir: /tmp
volumes:
- ${PWD}:/tmp
docker run --rm -v $(pwd):/tmp drakemazzy/ddk-coder:latest vendor/bin/grumphp run
Add to your .git/hooks/pre-commit:
#!/bin/sh
docker run --rm -v $(pwd):/tmp drakemazzy/ddk-coder:latest vendor/bin/grumphp git:pre-commit
Make the hook executable:
chmod +x .git/hooks/pre-commit
The image supports the following build arguments:
| Argument | Description | Default |
|---|---|---|
| PHP_VER | PHP version | 84 |
| COMPOSER_VER | Composer version | 2.8.5 |
| CODER_VER | Coder version | 8.3.28 |
| BUILD_VER | Build version | git SHA |
| BUILD_DATE | Build date | Current UTC |
The image is available for the following platforms:
This image includes:
docker buildx build --platform linux/amd64,linux/arm64 -t drakemazzy/ddk-coder:latest .
This project is released under the GNU General Public License v2.0 (as provided by GitHub), with the "or (at your option) any later version" clause, because pfrenssen/coder is licensed under GPL-2.0-or-later.
In short:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 (or at your option) any later version.
For more details, see the LICENSE file in this repository or the official GPL v2 text.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any problems or have suggestions, please open an issue in the GitHub repository.
Content type
Image
Digest
sha256:fb199495c…
Size
11.2 MB
Last updated
about 1 year ago
docker pull drakemazzy/ddk-coder