From cb3631021b17da150b62649d50125914a7387d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Thu, 18 Jun 2020 09:14:22 +0200 Subject: [PATCH 1/2] Enhancement: Use ergebnis/composer-normalize to normalize composer.json --- .github/CONTRIBUTING.md | 14 +++++++++++++- .github/workflows/integrate.yaml | 5 +++++ Makefile | 6 +++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 89030cb..9e8ff6c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -7,6 +7,18 @@ For details, take a look at the following workflow configuration files: - [`workflows/integrate.yaml`](workflows/integrate.yaml) - [`workflows/release.yaml`](workflows/release.yaml) +## Coding Standards + +We are using [`ergebnis/composer-normalize`](https://github.com/ergebnis/composer-normalize) to normalize `composer.json`. + +Run + +``` +$ make coding-standards +``` + +to automatically fix coding standard violations. + ## Tests We are using [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) to drive the development. @@ -27,7 +39,7 @@ Run $ make ``` -to run tests! +to enforce coding standards and run tests! ## Help diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index b454b21..17b7d67 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -32,6 +32,11 @@ jobs: - name: "Validate composer.json and composer.lock" run: "composer validate --strict" + - name: "Run ergebnis/composer-normalize" + uses: "docker://ergebnis/composer-normalize-action:0.8.0" + with: + args: "--dry-run" + tests: name: "Tests" diff --git a/Makefile b/Makefile index 39c8bd3..a41c99e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,9 @@ .PHONY: it -it: tests ## Runs the tests target +it: coding-standards tests ## Runs the coding-standards and tests target + +.PHONY: coding-standards +coding-standards: vendor ## Normalizes composer.json with ergebnis/composer-normalize + docker run --interactive --rm --tty --workdir=/app --volume ${PWD}:/app ergebnis/composer-normalize-action:0.8.0 .PHONY: help help: ## Displays this list of targets with descriptions From ff7a3913c24d56217f202797adca28e092bc6adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Thu, 18 Jun 2020 09:16:32 +0200 Subject: [PATCH 2/2] Fix: Run 'make coding-standards' --- composer.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index f2d996e..85d5b38 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,14 @@ "require": { "php": ">=5.4" }, + "require-dev": { + "phpunit/phpunit": "^4.8" + }, + "config": { + "platform": { + "php": "5.4.45" + } + }, "autoload": { "psr-4": { "Tree\\": "src/" @@ -22,13 +30,5 @@ "psr-4": { "Tree\\Test\\": "tests/" } - }, - "config": { - "platform": { - "php": "5.4.45" - } - }, - "require-dev": { - "phpunit/phpunit": "^4.8" } }