-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Добавляет конфигурацию Code_Sniffer и статический анализатор Psalm
- Loading branch information
Showing
3 changed files
with
104 additions
and
19 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 |
---|---|---|
@@ -1,21 +1,45 @@ | ||
{ | ||
"name": "mihdan/wp-oop-settings-api", | ||
"description": "WP-OOP-Settings-API is a Settings API wrapper built with Object Oriented Programming practices.", | ||
"type": "library", | ||
"license": "GPL-2.0", | ||
"authors": [ | ||
{ | ||
"name": "Mikhail Kobzarev", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Ahmad Awais", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"autoload" : { | ||
"psr-4" : { | ||
"Mihdan\\WPOSA\\" : "src/" | ||
} | ||
} | ||
"name": "mihdan/wp-oop-settings-api", | ||
"description": "WP-OOP-Settings-API is a Settings API wrapper built with Object Oriented Programming practices.", | ||
"type": "library", | ||
"license": "GPL-2.0-or-later", | ||
"authors": [ | ||
{ | ||
"name": "Mikhail Kobzarev", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Ahmad Awais", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"autoload": { | ||
"psr-4": { | ||
"Mihdan\\WPOSA\\": "src/" | ||
} | ||
}, | ||
"config": { | ||
"platform": { | ||
"php": "7.4" | ||
} | ||
}, | ||
"require": { | ||
"php": ">=7.4", | ||
"ext-json": "*" | ||
}, | ||
"require-dev": { | ||
"roave/security-advisories": "dev-latest", | ||
"squizlabs/php_codesniffer": "^3.6", | ||
"phpcompatibility/php-compatibility": "^9.3", | ||
"phpcompatibility/phpcompatibility-wp": "^2.1", | ||
"wp-coding-standards/wpcs": "^2.3", | ||
"php-coveralls/php-coveralls": "^v2.4", | ||
"vimeo/psalm": "^4.20", | ||
"humanmade/psalm-plugin-wordpress": "^2.0" | ||
}, | ||
"scripts": { | ||
"phpcs": "phpcs --standard=./phpcs.xml", | ||
"phpcbf": "phpcbf --standard=./phpcs.xml", | ||
"psalm": "psalm --config=./psalm.xml" | ||
} | ||
} |
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,43 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="WordPress Plugin Coding Standards"> | ||
<description>A custom set of code standard rules to check for WordPress plugins.</description> | ||
|
||
<!-- What to scan --> | ||
<file>.</file> | ||
<exclude-pattern>*/\.github/*</exclude-pattern> | ||
<exclude-pattern>*/examples/*</exclude-pattern> | ||
<exclude-pattern>*/vendor/*</exclude-pattern> | ||
|
||
<!-- How to scan --> | ||
<arg value="sp"/><!-- Show sniff and progress --> | ||
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit --> | ||
<arg name="extensions" value="php"/> | ||
<arg name="parallel" value="12"/><!-- Enables parallel processing when available for faster results. --> | ||
<arg name="cache" value=".phpcs.cache"/> | ||
|
||
<config name="installed_paths" value="vendor/phpcompatibility/php-compatibility,vendor/phpcompatibility/phpcompatibility-paragonie,vendor/phpcompatibility/phpcompatibility-wp,vendor/wp-coding-standards/wpcs"/> | ||
<config name="testVersion" value="7.4-"/> | ||
|
||
<!-- Rules: Check PHP version compatibility --> | ||
<rule ref="PHPCompatibility"/> | ||
<rule ref="PHPCompatibilityWP"/> | ||
|
||
<!-- Rules: WordPress Coding Standards --> | ||
<config name="minimum_supported_wp_version" value="5.1"/> | ||
|
||
<rule ref="WordPress"> | ||
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found"/> | ||
<exclude name="WordPress.PHP.DisallowShortTernary.Found"/> | ||
<exclude name="WordPress.PHP.YodaConditions" /> | ||
<exclude name="WordPress.Files.FileName.InvalidClassFileName" /> | ||
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" /> | ||
<exclude name="PEAR.NamingConventions.ValidClassName.Invalid" /> | ||
</rule> | ||
|
||
<!-- Allow symbol `/` in hook names. --> | ||
<rule ref="WordPress.NamingConventions.ValidHookName"> | ||
<properties> | ||
<property name="additionalWordDelimiters" value="/" /> | ||
</properties> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
errorLevel="3" | ||
resolveFromConfigFile="true" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | ||
> | ||
<projectFiles> | ||
<directory name="src"/> | ||
<ignoreFiles> | ||
<directory name="vendor"/> | ||
<directory name="examples"/> | ||
</ignoreFiles> | ||
</projectFiles> | ||
<plugins> | ||
<pluginClass class="PsalmWordPress\Plugin"/></plugins> | ||
</psalm> |