From c1199b86ed33d70a706075ac5ab8b329b6828f55 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Fri, 14 May 2021 11:15:55 +0200 Subject: [PATCH 1/2] Drop Phing for Makefile See https://github.com/phpstan/phpstan-symfony/pull/160 --- .gitattributes | 10 +++- .github/workflows/build.yml | 10 ++-- .gitignore | 4 +- Makefile | 23 ++++++++ build-cs/composer.json | 2 +- build.xml | 112 ------------------------------------ composer.json | 1 - phpcs.xml | 11 +++- phpunit.xml | 36 ++++++++++++ tests/phpunit.xml | 27 --------- tmp/.gitignore | 3 + tmp/cache/.gitignore | 2 + 12 files changed, 92 insertions(+), 149 deletions(-) create mode 100644 Makefile delete mode 100644 build.xml create mode 100644 phpunit.xml delete mode 100644 tests/phpunit.xml create mode 100644 tmp/.gitignore create mode 100644 tmp/cache/.gitignore diff --git a/.gitattributes b/.gitattributes index 3aab121..615bf05 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,4 +2,12 @@ *.stub linguist-language=PHP *.neon linguist-language=YAML -/tests export-ignore +.github export-ignore +tests export-ignore +tmp export-ignore +.gitattributes export-ignore +.gitignore export-ignore +Makefile export-ignore +phpcs.xml export-ignore +phpstan.neon export-ignore +phpunit.xml export-ignore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aba91f0..3cf185e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,7 @@ jobs: - name: "Lint" - run: "vendor/bin/phing lint" + run: "make lint" coding-standards: name: "Coding Standard" @@ -68,10 +68,10 @@ jobs: run: "composer install --no-interaction --no-progress --no-suggest" - name: "Lint" - run: "vendor/bin/phing lint" + run: "make lint" - name: "Coding Standard" - run: "vendor/bin/phing cs" + run: "make cs" tests: name: "Tests" @@ -113,7 +113,7 @@ jobs: run: "composer require --dev phpunit/phpunit:'^9.5' --update-with-dependencies" - name: "Tests" - run: "vendor/bin/phing tests" + run: "make tests" static-analysis: name: "PHPStan" @@ -157,4 +157,4 @@ jobs: run: "composer require --dev phpunit/phpunit:'^9.5' --update-with-dependencies" - name: "PHPStan" - run: "vendor/bin/phing phpstan" + run: "make phpstan" diff --git a/.gitignore b/.gitignore index ff72e2d..d6a83e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ -/composer.lock +/tests/tmp /vendor +composer.lock +.phpunit.result.cache diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fe917d3 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +.PHONY: check +check: lint cs tests phpstan + +.PHONY: tests +tests: + php vendor/bin/phpunit + +.PHONY: lint +lint: + php vendor/bin/parallel-lint --colors \ + src tests + +.PHONY: cs +cs: + composer install --working-dir build-cs && php build-cs/vendor/bin/phpcs + +.PHONY: cs-fix +cs-fix: + php build-cs/vendor/bin/phpcbf + +.PHONY: phpstan +phpstan: + php vendor/bin/phpstan analyse -l 8 -c phpstan.neon src tests diff --git a/build-cs/composer.json b/build-cs/composer.json index 9acd027..ed7744e 100644 --- a/build-cs/composer.json +++ b/build-cs/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "consistence/coding-standard": "^3.10", + "consistence-community/coding-standard": "^3.10", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "slevomat/coding-standard": "^6.4" } diff --git a/build.xml b/build.xml deleted file mode 100644 index b5655b3..0000000 --- a/build.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/composer.json b/composer.json index 9af1914..a1382dc 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,6 @@ "require-dev": { "nette/forms": "^3.0", "nette/utils": "^2.3.0 || ^3.0.0", - "phing/phing": "^2.16.3", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-php-parser": "^0.12.2", "phpstan/phpstan-phpunit": "^0.12.16", diff --git a/phpcs.xml b/phpcs.xml index 49653b4..152a898 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,6 +1,14 @@ - + + + + + + + src + tests + @@ -53,5 +61,6 @@ + tests/tmp tests/*/data diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..db289fe --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,36 @@ + + + + + ./src + + + + + + + + + + tests + + + + + diff --git a/tests/phpunit.xml b/tests/phpunit.xml deleted file mode 100644 index 1a84817..0000000 --- a/tests/phpunit.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - ../src - - - - - - - diff --git a/tmp/.gitignore b/tmp/.gitignore new file mode 100644 index 0000000..37890ca --- /dev/null +++ b/tmp/.gitignore @@ -0,0 +1,3 @@ +* +!cache +!.* diff --git a/tmp/cache/.gitignore b/tmp/cache/.gitignore new file mode 100644 index 0000000..125e342 --- /dev/null +++ b/tmp/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.* From 122652585bfe23e1827eb98b73d2104fd90847cd Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Sat, 15 May 2021 00:52:32 +0200 Subject: [PATCH 2/2] fix(lint): exclude 'tests/Rule/Nette/data' --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fe917d3..4170123 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,8 @@ tests: .PHONY: lint lint: php vendor/bin/parallel-lint --colors \ - src tests + src tests \ + --exclude tests/Rule/Nette/data .PHONY: cs cs: