From 4530d56c3574d44f0d64d38368f8e41a48887bb8 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Sat, 15 May 2021 00:50:10 +0200 Subject: [PATCH] Drop Phing for Makefile See https://github.com/phpstan/phpstan-symfony/pull/160 --- .gitattributes | 20 ++++--- .gitignore | 5 +- Makefile | 30 ++++++++++ build.xml | 136 ------------------------------------------- composer.json | 1 - phpcs.xml | 8 +++ phpunit.xml | 36 ++++++++++++ tests/phpunit.xml | 17 ------ tmp/.gitignore | 3 + tmp/cache/.gitignore | 2 + 10 files changed, 93 insertions(+), 165 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 6462e415..c1e4760c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,15 +1,17 @@ *.abnf text eol=crlf +*.php text eol=lf -/tests export-ignore -/doc/grammars export-ignore -/build-cs export-ignore +.github export-ignore +build-cs export-ignore +doc/grammars export-ignore +tests export-ignore +tmp export-ignore +.editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore -.editorconfig export-ignore -.github export-ignore -build.xml export-ignore -phpcs.xml export-ignore -build.xml export-ignore -phpstan.neon export-ignore build-abnfgen.sh export-ignore CODE_OF_CONDUCT.md export-ignore +Makefile export-ignore +phpcs.xml export-ignore +phpstan.neon export-ignore +phpunit.xml export-ignore diff --git a/.gitignore b/.gitignore index c67023cd..dab69838 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /temp /tools +/tests/tmp /vendor - -/composer.lock +composer.lock +.phpunit.result.cache diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..d0daa77b --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +.PHONY: check +check: build-abnfgen lint cs tests phpstan + +.PHONY: tests +tests: + php vendor/bin/phpunit + +.PHONY: lint +lint: + php vendor/bin/parallel-lint --colors \ + src tests \ + --exclude tests/PHPStan/Analyser/data \ + --exclude tests/PHPStan/Rules/Methods/data \ + --exclude tests/PHPStan/Rules/Functions/data + +.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 5 -c phpstan.neon src tests + +.PHONY: build-abnfgen +build-abnfgen: + ./build-abnfgen.sh diff --git a/build.xml b/build.xml deleted file mode 100644 index 04716105..00000000 --- a/build.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/composer.json b/composer.json index e187ef26..2f08f4d0 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,6 @@ "php": "^7.1 || ^8.0" }, "require-dev": { - "phing/phing": "^2.16.3", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^0.12.60", diff --git a/phpcs.xml b/phpcs.xml index 70888213..f50b4585 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,6 +1,14 @@ + + + + + + + src + tests diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 00000000..6d50fc82 --- /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 f4762951..00000000 --- a/tests/phpunit.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - PHPStan - - - diff --git a/tmp/.gitignore b/tmp/.gitignore new file mode 100644 index 00000000..37890cae --- /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 00000000..125e3429 --- /dev/null +++ b/tmp/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.*