Skip to content

Commit

Permalink
GH Actions: add task to test example ruleset
Browse files Browse the repository at this point in the history
... to prevent typos like reported in 2375 from entering it.
  • Loading branch information
jrfnl committed Sep 3, 2023
1 parent c961efc commit d7d4de3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/basic-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ jobs:
- name: Test the WordPress ruleset
run: $(pwd)/vendor/bin/phpcs -ps ./Tests/RulesetCheck/class-ruleset-test.inc --standard=WordPress

- name: Rename the example ruleset to one which can be used for a ruleset
run: cp phpcs.xml.dist.sample sample.xml

- name: Test the example ruleset
run: $(pwd)/vendor/bin/phpcs -ps ./Tests/RulesetCheck/example-ruleset-test.inc --standard=./sample.xml

# Test for fixer conflicts by running the auto-fixers of the complete WPCS over the test case files.
# This is not an exhaustive test, but should give an early indication for typical fixer conflicts.
# If only fixable errors are found, the exit code will be 1, which can be interpreted as success.
Expand Down
8 changes: 8 additions & 0 deletions Tests/RulesetCheck/example-ruleset-test.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
/**
* File which should not yield any errors when using the example ruleset.
*
* @package My\Prefix\Package
*/

$my_prefix_var = 'hello';

0 comments on commit d7d4de3

Please sign in to comment.