Skip to content

Commit 80a7bcc

Browse files
committed
Changed CodeSniffer error levels
- No error exit code for warnings - Changed entire ruleset to ERROR level - Left PhpDoc\RequiredForPublicApiSniff on WARNING level - Added colors to output in composer.json & build.yml
1 parent c8b0233 commit 80a7bcc

File tree

6 files changed

+19
-11
lines changed

6 files changed

+19
-11
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ jobs:
4545
run: vendor/bin/php-cs-fixer --dry-run -v --config=cs-fixer.php.dist --path-mode=intersection fix src tests
4646
- name: "Coding standard CodeSniffer checks"
4747
run: |
48-
vendor/bin/phpcs --extensions=php --standard=phpcs.xml.dist src
49-
vendor/bin/phpcs --extensions=php --standard=phpcs.xml.dist --ignore=*/code-samples/* tests
48+
vendor/bin/phpcs --extensions=php --standard=phpcs.xml.dist --colors src
49+
vendor/bin/phpcs --extensions=php --standard=phpcs.xml.dist --colors --ignore=*/code-samples/* tests
5050
- name: "Package skeleton validation"
5151
run: php polymorphine-skeleton check
5252
- name: "Run PhpUnit tests with coverage"

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"scripts": {
3535
"test-cs": [
3636
"php-cs-fixer --dry-run -v --config=cs-fixer.php.dist --path-mode=intersection fix src tests",
37-
"phpcs --extensions=php --standard=phpcs.xml.dist src",
38-
"phpcs --extensions=php --standard=phpcs.xml.dist --ignore=*/code-samples/* tests"
37+
"phpcs --extensions=php --standard=phpcs.xml.dist --colors src",
38+
"phpcs --extensions=php --standard=phpcs.xml.dist --colors --ignore=*/code-samples/* tests"
3939
],
4040
"test-php": "phpunit",
4141
"test-skeleton": "@php polymorphine-skeleton check"

phpcs.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<?xml version="1.0"?>
22
<!-- Code Sniffer configuration for projects using Polymorphine\Dev coding standard as composer dependency -->
33
<ruleset name="polymorphine-package">
4+
<config name="ignore_warnings_on_exit" value="true"/>
45
<autoload>../../autoload.php</autoload>
5-
<rule ref="./src/Sniffer"/>
6+
<rule ref="./src/Sniffer">
7+
<type>error</type>
8+
</rule>
69
<rule ref="Sniffer.PhpDoc.RequiredForPublicApi">
10+
<type>warning</type>
711
<exclude-pattern>*/tests/*</exclude-pattern>
812
</rule>
913
</ruleset>

phpcs.xml.dist

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<?xml version="1.0"?>
2-
<!-- Code Sniffer configuration for Polymorphine/Dev package files -->
2+
<!-- Code Sniffer configuration for Polymorphine/Dev package itself -->
33
<ruleset name="polymorphine-dev">
4+
<config name="ignore_warnings_on_exit" value="true"/>
45
<autoload>./vendor/autoload.php</autoload>
5-
<rule ref="./src/Sniffer"/>
6+
<rule ref="./src/Sniffer">
7+
<type>error</type>
8+
</rule>
69
<rule ref="Sniffer.PhpDoc.RequiredForPublicApi">
10+
<type>warning</type>
711
<exclude-pattern>*/tests/*</exclude-pattern>
812
</rule>
913
</ruleset>

template/.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ jobs:
4545
run: vendor/bin/php-cs-fixer --dry-run -v --config=cs-fixer.php.dist --path-mode=intersection fix src tests
4646
- name: "Coding standard CodeSniffer checks"
4747
run: |
48-
vendor/bin/phpcs --extensions=php --standard=${tpl.PHPCS} src
49-
vendor/bin/phpcs --extensions=php --standard=${tpl.PHPCS} --ignore=*/code-samples/* tests
48+
vendor/bin/phpcs --extensions=php --standard=${tpl.PHPCS} --colors src
49+
vendor/bin/phpcs --extensions=php --standard=${tpl.PHPCS} --colors --ignore=*/code-samples/* tests
5050
- name: "Package skeleton validation"
5151
run: ${tpl.PHP_EXEC}polymorphine-skeleton check
5252
- name: "Run PhpUnit tests with coverage"

template/composer.json.sk_file

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"scripts": {
3232
"test-cs": [
3333
"php-cs-fixer --dry-run -v --config=cs-fixer.php.dist --path-mode=intersection fix src tests",
34-
"phpcs --extensions=php --standard={$tpl.PHPCS} src",
35-
"phpcs --extensions=php --standard={$tpl.PHPCS} --ignore=*/code-samples/* tests"
34+
"phpcs --extensions=php --standard={$tpl.PHPCS} --colors src",
35+
"phpcs --extensions=php --standard={$tpl.PHPCS} --colors --ignore=*/code-samples/* tests"
3636
],
3737
"test-php": "phpunit",
3838
"test-skeleton": "{$tpl.PHP_EXEC}polymorphine-skeleton check"

0 commit comments

Comments
 (0)