diff --git a/.gitattributes b/.gitattributes index 18e14aad..48387724 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,11 @@ -/tests export-ignore +*.php text eol=lf + +.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/.gitignore b/.gitignore index ff72e2d0..d6a83e59 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 00000000..fe917d3b --- /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 9acd0275..ed7744e1 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 df23f25f..00000000 --- a/build.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/phpcs.xml b/phpcs.xml index b7857d89..067a6a8e 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 00000000..f9f3afe2 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,36 @@ + + + + + ./src + + + + + + + + + + tests + + + + + diff --git a/tests/Rules/ForLoop/data/data.php b/tests/Rules/ForLoop/data/data.php index 2334e8b7..211e4014 100644 --- a/tests/Rules/ForLoop/data/data.php +++ b/tests/Rules/ForLoop/data/data.php @@ -1,62 +1,62 @@ - - - - ../src - - - - - - 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 @@ +* +!.*