-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: add wp coding standards and fix issues
- Loading branch information
Showing
10 changed files
with
509 additions
and
73 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 |
---|---|---|
|
@@ -15,3 +15,4 @@ | |
|
||
/composer.lock export-ignore | ||
/phpstan.neon export-ignore | ||
/.phpcs.xml export-ignore |
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,35 @@ | ||
name: PHPCS and PHPStan Check | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "**.php" | ||
pull_request: | ||
paths: | ||
- "**.php" | ||
|
||
jobs: | ||
phpcs: | ||
name: Run PHPCS | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: 🐘 Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "8.1" | ||
|
||
- name: 📥 Install PHP dependencies | ||
uses: ramsey/composer-install@v2 | ||
with: | ||
composer-options: "--classmap-authoritative" | ||
|
||
- name: ✨ PHPCS | ||
run: composer analyse:phpcs | ||
|
||
- name: 🧐 PHPStan | ||
run: composer analyse:phpstan |
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,26 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Custom"> | ||
<file>.</file> | ||
<exclude-pattern>/vendor/*</exclude-pattern> | ||
<exclude-pattern>/node_modules/*</exclude-pattern> | ||
<exclude-pattern>/src/*</exclude-pattern> | ||
<exclude-pattern>/build/*</exclude-pattern> | ||
<exclude-pattern>/*.js</exclude-pattern> | ||
|
||
<config name="minimum_wp_version" value="6.3"/> | ||
<arg name="basepath" value="."/> | ||
|
||
<rule ref="WordPress"> | ||
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/> | ||
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/> | ||
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/> | ||
<exclude name="Squiz.Commenting.FileComment.Missing"/> | ||
<exclude name="Squiz.Commenting.ClassComment.Missing"/> | ||
<exclude name="Squiz.Commenting.FunctionComment.Missing"/> | ||
<exclude name="Generic.Commenting.DocComment.MissingShort"/> | ||
<exclude name="WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode"/> | ||
<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/> | ||
<exclude name="WordPress.WP.AlternativeFunctions.json_encode_json_encode"/> | ||
<exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents"/> | ||
</rule> | ||
</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
Oops, something went wrong.