Skip to content

Commit 8dabc1a

Browse files
committed
travis: tested using Nette Coding Standard
1 parent 41624ee commit 8dabc1a

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

.travis.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,34 @@ matrix:
1212
env: dependencies="--prefer-lowest --prefer-stable" PHP_BIN=php
1313
- php: 7.1
1414
env: coverage=on
15+
- php: 7.1
16+
env: codingStandard=on
1517

1618
allow_failures:
1719
- php: 7.1
1820
env: coverage=on
1921

2022
script:
21-
- vendor/bin/tester -p $PHP_BIN tests -s $coverageArgs
22-
- php temp/code-checker/src/code-checker.php --short-arrays --strict-types
23+
- if [ "$PHP_BIN" ]; then vendor/bin/tester -p $PHP_BIN tests -s $coverageArgs; fi
24+
- >
25+
if [ "$codingStandard" == "on" ]; then
26+
php temp/code-checker/src/code-checker.php --short-arrays --strict-types;
27+
php temp/coding-standard/ecs check src tests --config tests/coding-standard.neon;
28+
fi
2329
2430
after_failure:
2531
# Print *.actual content
2632
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
2733

2834
before_script:
29-
# Install Nette Tester & Code Checker
35+
# Install Nette Tester
3036
- travis_retry composer update --no-interaction --prefer-dist $dependencies
31-
- travis_retry composer create-project nette/code-checker temp/code-checker ~2.8 --no-interaction
37+
# Install Code Checkers
38+
- >
39+
if [ "$codingStandard" == "on" ]; then
40+
travis_retry composer create-project nette/code-checker temp/code-checker ~2 --no-interaction;
41+
travis_retry composer create-project nette/coding-standard temp/coding-standard --no-interaction;
42+
fi
3243
- if [ "$coverage" == "on" ]; then PHP_BIN=phpdbg; coverageArgs="--coverage ./coverage.xml --coverage-src ./src"; fi
3344

3445
after_script:

tests/coding-standard.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
includes:
2+
- ../temp/coding-standard/coding-standard-php71.neon
3+
4+
parameters:
5+
skip:
6+
PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer:
7+
- tests/UI/Presenter.paramChecking.phpt # intentionally for testing

0 commit comments

Comments
 (0)