Skip to content

Commit

Permalink
CI: Install coding standard as dev dependency and introduce project c…
Browse files Browse the repository at this point in the history
…onfig
  • Loading branch information
xificurk committed Jan 26, 2019
1 parent 8ccc71d commit b99f2ec
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/vendor
/composer.lock
/phpstan*.neon
/.phpcs.xml
/.phpcs-cache
30 changes: 30 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<ruleset>
<config name="installed_paths" value="../../nepada/coding-standard/src"/><!-- relative path from PHPCS source location -->

<arg value="ps"/><!-- show progress of the run, show sniff names -->
<arg name="cache" value=".phpcs-cache"/>

<arg name="extensions" value="php,phpt"/>
<file>src</file>
<file>tests</file>

<rule ref="Nepada">
</rule>

<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="ignoredAnnotationNames" type="array">
<element value="@testCase"/>
<element value="@dataProvider"/>
</property>
</properties>
</rule>

<!-- special settings for tests and bootstrap -->
<exclude-pattern>*/tests/temp/*</exclude-pattern>
<rule ref="PSR1.Files.SideEffects">
<exclude-pattern>*.phpt</exclude-pattern>
<exclude-pattern>*/bootstrap.php</exclude-pattern>
</rule>
</ruleset>
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ matrix:
include:
- stage: Code Standard Checker
php: 7.1
install:
- mkdir -p /tmp/coding-standard
- composer --working-dir=/tmp/coding-standard init
- travis_retry composer --working-dir=/tmp/coding-standard require --no-interaction --prefer-dist --update-no-dev nepada/coding-standard ^5.0.0
script:
- /tmp/coding-standard/vendor/bin/phpcs --standard=/tmp/coding-standard/vendor/nepada/coding-standard/src/Nepada/ruleset.xml -sp src tests
- vendor/bin/phpcs
- stage: Code Coverage
php: 7.1
script:
- vendor/bin/tester -p phpdbg tests -s --coverage ./coverage.xml --coverage-src ./src
after_script:
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"nette/tester": "^2.1",
"xificurk/phpstan-shim": "^0.11",
"jakub-onderka/php-parallel-lint": "^1.0",
"nepada/coding-standard": "^6.0.0",
"nette/bootstrap": "^2.4.1@dev || ^3.0@dev",
"nette/di": "^2.4.7@dev",
"latte/latte": "^2.4@dev",
Expand Down

0 comments on commit b99f2ec

Please sign in to comment.