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 diff --git a/composer.json b/composer.json index 67d3756..d5ebf68 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,14 @@ "require": { "php": "^5.4 || ^7.0" }, + "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" } }