Skip to content

Commit 5297707

Browse files
xaloppmmoll
authored andcommitted
improve coding standard testing
1 parent 10cbfc4 commit 5297707

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ before_script:
1414

1515
script:
1616
- vendor/bin/phpunit --filter MO4
17-
- vendor/bin/phpcs MO4 --report=full -np
17+
- vendor/bin/phpcs

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you contribute code, please make sure it conforms to the PHPCS coding standar
2020

2121
1. To check the coding standard, execute in the repository root:
2222

23-
./vendor/bin/phpcs MO4
23+
./vendor/bin/phpcs
2424

2525
2. To run the unit tests, execute in the repository root:
2626

phpcs.mo4.xml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHP_CodeSniffer">
3+
<description>The coding standard for PHP_CodeSniffer itself.</description>
4+
5+
<!-- Sensible default configuration settings for coding standard checking of MO4. -->
6+
<file>MO4</file>
7+
8+
<exclude-pattern>*/Tests/*\.(inc|css|js)</exclude-pattern>
9+
<exclude-pattern>vendor/*</exclude-pattern>
10+
11+
<arg name="basepath" value="."/>
12+
<arg name="colors" />
13+
<arg name="parallel" value="75" />
14+
<arg value="np"/>
15+
</ruleset>

phpcs.xml.dist

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
<?xml version="1.0"?>
22
<ruleset name="PHP_CodeSniffer">
3-
<description>The coding standard for PHP_CodeSniffer itself.</description>
3+
<description>The coding standard for PHP_CodeSniffer itself, applied to MO4.</description>
44

5-
<exclude-pattern>*/Tests/*\.(inc|css|js)</exclude-pattern>
6-
<exclude-pattern>vendor/*</exclude-pattern>
5+
<!-- Load sensible default configuration settings for coding standard checking of MO4. -->
6+
<!-- These configuration settings can only be overridden by CLI! -->
7+
<!-- The precedence order is: -->
8+
<!-- 1. CLI parameters -->
9+
<!-- 2. followed by configuration settings imported from rulesets, first come, first serve -->
10+
<!-- 3. and finally the configuration from this file itself! -->
11+
<rule ref="phpcs.mo4.xml" />
712

813
<rule ref="vendor/squizlabs/php_codesniffer/phpcs.xml.dist" />
914
</ruleset>

0 commit comments

Comments
 (0)