Skip to content

Commit 33cc228

Browse files
committed
add more XML validation and formatting
1 parent 53e5b5c commit 33cc228

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

.travis.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,15 @@ before_script:
2323
- if [ "${DEPENDENCIES}" = "lowest" ]; then composer update --prefer-lowest --prefer-dist --no-interaction --no-progress; fi;
2424
- if [ "${DEPENDENCIES}" = "highest" ]; then composer update --prefer-dist --no-interaction --no-progress; fi;
2525
- if [ "${DEPENDENCIES}" = "highest" ]; then pecl install -f ast-1.0.7; fi; # Install AST extension, as phan uses it
26+
- export XMLLINT_INDENT=" "
2627

2728
script:
28-
- xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd MO4/ruleset.xml # validate MO4's ruleset XML
29+
- xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd MO4/ruleset.xml
30+
- xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd phpcs.mo4.xml
31+
- xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd phpcs.xml.dist
32+
- diff -B MO4/ruleset.xml <(xmllint --format MO4/ruleset.xml)
33+
- diff -B phpcs.mo4.xml <(xmllint --format phpcs.mo4.xml)
34+
- diff -B phpcs.xml.dist <(xmllint --format phpcs.xml.dist)
2935
- vendor/bin/phpcs -s --standard=MO4 integrationtests/testfile.php # Check, if all the sniffs work with the current dependencies
3036
- vendor/bin/phpunit # Run tests
3137
- vendor/bin/phpcs # Stylecheck against PHPCS's ruleset

MO4/ruleset.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@
8080
<!-- Require presence of constant visibility -->
8181
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"/>
8282
<!-- Forbid multi constant definition -->
83-
<rule ref="SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition" />
83+
<rule ref="SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition"/>
8484
<!-- Forbid multi property definition -->
85-
<rule ref="SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition" />
85+
<rule ref="SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition"/>
8686
<!-- Forbid empty lines after class/interface/trait opening and before closing braces -->
8787
<rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces">
8888
<properties>

phpcs.mo4.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<exclude-pattern>vendor/*</exclude-pattern>
1111

1212
<arg name="basepath" value="."/>
13-
<arg name="colors" />
14-
<arg name="parallel" value="75" />
13+
<arg name="colors"/>
14+
<arg name="parallel" value="75"/>
1515
<arg value="np"/>
1616
</ruleset>

phpcs.xml.dist

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- 1. CLI parameters -->
99
<!-- 2. followed by configuration settings imported from rulesets, first come, first serve -->
1010
<!-- 3. and finally the configuration from this file itself! -->
11-
<rule ref="phpcs.mo4.xml" />
11+
<rule ref="phpcs.mo4.xml"/>
1212

13-
<rule ref="vendor/squizlabs/php_codesniffer/phpcs.xml.dist" />
13+
<rule ref="vendor/squizlabs/php_codesniffer/phpcs.xml.dist"/>
1414
</ruleset>

0 commit comments

Comments
 (0)