https://github.com/tinect/shopware-easy-coding-standard-docker
https://github.com/tinect/shopware-easy-coding-standard-docker
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tinect/shopware-easy-coding-standard-docker
- Owner: tinect
- Created: 2022-01-31T07:18:46.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-02T21:16:55.000Z (over 2 years ago)
- Last Synced: 2025-01-27T08:42:43.356Z (over 1 year ago)
- Language: Dockerfile
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a docker image to easily run easy-coding-standard.
`--config /tmp/ecs.php` uses a recent version of shopware [ecs.php](https://github.com/shopware/platform/blob/trunk/ecs.php)
`src` is the folder of your code to check and fix
PHP 7.4:
```shell
docker run --rm -v ${PWD}:/app ghcr.io/tinect/shopware-easy-coding-standard:7.4 check --fix --config /tmp/ecs.php src
```
PHP 8.0:
```shell
docker run --rm -v ${PWD}:/app ghcr.io/tinect/shopware-easy-coding-standard:8 check --fix --config /tmp/ecs.php src
```
PHP 8.1:
```shell
docker run --rm -v ${PWD}:/app ghcr.io/tinect/shopware-easy-coding-standard:8.1 check --fix --config /tmp/ecs.php src
```
run with recent changed files:
```shell
STAGED_PHP_FILES_CMD=`git diff --name-only --diff-filter=ACM $(git merge-base main HEAD) | grep \\.php`
CHANGED_PHP_FILES_CMD=`git diff --name-only --diff-filter=ACM | grep \\.php`
if [[ -z "$CHANGED_PHP_FILES_CMD" && -z "$STAGED_PHP_FILES_CMD" ]]
then
exit 0
fi
docker run --rm -v ${PWD}:/app ghcr.io/tinect/shopware-easy-coding-standard check --fix --config /tmp/ecs.php $STAGED_PHP_FILES_CMD $CHANGED_PHP_FILES_CMD
```