-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PHP_CodeSniffer for checking coding standards
- Loading branch information
1 parent
8feaae5
commit e7559b6
Showing
5 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Coding Standards | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
phpcs: | ||
name: PHP_CodeSniffer | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
coverage: none | ||
|
||
- name: Install Composer dependencies | ||
uses: ramsey/composer-install@v2 | ||
|
||
- name: Run test suite | ||
run: composer coding-standards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Custom ruleset"> | ||
<description>Coding standards for PHPUnit Markup Assertions</description> | ||
|
||
<!-- Show progress and sniff codes in all reports --> | ||
<arg value="ps"/> | ||
|
||
<!-- Check all PHP files in directory tree by default. --> | ||
<arg name="extensions" value="php"/> | ||
<file>.</file> | ||
<exclude-pattern>*/vendor/*</exclude-pattern> | ||
|
||
<!-- Default to PSR-12 for coding standards--> | ||
<rule ref="PSR12"/> | ||
|
||
<!-- The tests/ directory may use snake_case for test methods --> | ||
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
|
||
<!-- Ensure we're compatible with PHP 5.6+ --> | ||
<rule ref="PHPCompatibility"/> | ||
<config name="testVersion" value="5.6-"/> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* Markup assertions for PHPUnit. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters