mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
NEW Amend Travis build to run a simple PHP_CodeSniffer test.
At this stage, the test just checks line-length and line-endings, but previous commits have ensured that framework actually passes those tests. We can add more tests as we actually correct the code to pass those tests, and grow the test suite, as we had for unit tests.
This commit is contained in:
parent
1f7fc1f76a
commit
b7e7c165ff
@ -15,11 +15,14 @@ matrix:
|
|||||||
env: TESTDB=SQLITE
|
env: TESTDB=SQLITE
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
|
- pear install pear/PHP_CodeSniffer
|
||||||
|
- phpenv rehash
|
||||||
- ./tests/travis/before_script ~/builds/ss
|
- ./tests/travis/before_script ~/builds/ss
|
||||||
- cd ~/builds/ss
|
- cd ~/builds/ss
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- phpunit -c phpunit.xml.dist
|
- phpunit -c phpunit.xml.dist
|
||||||
|
- phpcs --encoding=utf-8 --tab-width=4 --standard=framework/tests/phpcs -np framework
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
irc:
|
irc:
|
||||||
|
38
tests/phpcs/ruleset.xml
Normal file
38
tests/phpcs/ruleset.xml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ruleset name="SilverStripe">
|
||||||
|
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>
|
||||||
|
|
||||||
|
<!-- exclude SCSS-generated CSS files -->
|
||||||
|
<exclude-pattern>*/css/*</exclude-pattern>
|
||||||
|
<exclude-pattern>css/*</exclude-pattern>
|
||||||
|
|
||||||
|
<!-- exclude thirdparty content -->
|
||||||
|
<exclude-pattern>thirdparty/*</exclude-pattern>
|
||||||
|
<exclude-pattern>*/jquery-changetracker/*</exclude-pattern>
|
||||||
|
<exclude-pattern>parsers/HTML/BBCodeParser/*</exclude-pattern>
|
||||||
|
|
||||||
|
<!-- PHP-PEG generated file not intended for human consumption -->
|
||||||
|
<exclude-pattern>*/SSTemplateParser.php$</exclude-pattern>
|
||||||
|
|
||||||
|
<rule ref="Generic.Files.LineEndings.InvalidEOLChar">
|
||||||
|
<severity>8</severity>
|
||||||
|
</rule>
|
||||||
|
<rule ref="Generic.Files.LineEndings">
|
||||||
|
<properties>
|
||||||
|
<property name="eolChar" value="\n" />
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
<rule ref="Generic.Files.LineLength.TooLong">
|
||||||
|
<severity>7</severity>
|
||||||
|
</rule>
|
||||||
|
<rule ref="Generic.Files.LineLength.MaxExceeded">
|
||||||
|
<severity>8</severity>
|
||||||
|
</rule>
|
||||||
|
<rule ref="Generic.Files.LineLength">
|
||||||
|
<properties>
|
||||||
|
<property name="lineLimit" value="120"/>
|
||||||
|
<property name="absoluteLineLimit" value="120"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
</ruleset>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user