From 2e29386503cfbc4f43aac3306a3deff741ced9c5 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 11 Jul 2017 00:33:28 +0200 Subject: [PATCH] travis: tested using Nette Coding Standard --- .travis.yml | 19 +++++++++++++++---- tests/coding-standard.neon | 7 +++++++ 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 tests/coding-standard.neon diff --git a/.travis.yml b/.travis.yml index 018cbda47..d8a257963 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,23 +12,34 @@ matrix: env: dependencies="--prefer-lowest --prefer-stable" PHP_BIN=php - php: 7.1 env: coverage=on + - php: 7.1 + env: codingStandard=on allow_failures: - php: 7.1 env: coverage=on script: - - vendor/bin/tester -p $PHP_BIN tests -s $coverageArgs - - php temp/code-checker/src/code-checker.php --short-arrays --strict-types + - if [ "$PHP_BIN" ]; then vendor/bin/tester -p $PHP_BIN tests -s $coverageArgs; fi + - > + if [ "$codingStandard" == "on" ]; then + php temp/code-checker/src/code-checker.php --short-arrays --strict-types; + php temp/coding-standard/ecs check src tests --config tests/coding-standard.neon; + fi after_failure: # Print *.actual content - for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done before_script: - # Install Nette Tester & Code Checker + # Install Nette Tester - travis_retry composer update --no-interaction --prefer-dist $dependencies - - travis_retry composer create-project nette/code-checker temp/code-checker ~2.8 --no-interaction + # Install Code Checkers + - > + if [ "$codingStandard" == "on" ]; then + travis_retry composer create-project nette/code-checker temp/code-checker ~2 --no-interaction; + travis_retry composer create-project nette/coding-standard temp/coding-standard --no-interaction; + fi - if [ "$coverage" == "on" ]; then PHP_BIN=phpdbg; coverageArgs="--coverage ./coverage.xml --coverage-src ./src"; fi after_script: diff --git a/tests/coding-standard.neon b/tests/coding-standard.neon new file mode 100644 index 000000000..5884fb25b --- /dev/null +++ b/tests/coding-standard.neon @@ -0,0 +1,7 @@ +includes: + - ../temp/coding-standard/coding-standard-php71.neon + +parameters: + skip: + PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer: + - tests/UI/Presenter.paramChecking.phpt # intentionally for testing