-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from wp-launchpad/fix/32-fix-phpcs
Added phpcs and some fixes
- Loading branch information
Showing
6 changed files
with
89 additions
and
16 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
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,19 +1,20 @@ | ||
<?php | ||
namespace Launchpad\Configs; | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
$plugin_name = 'Launchpad'; | ||
$plugin_name = 'Launchpad'; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound | ||
|
||
$plugin_launcher_path = dirname(__DIR__) . '/'; | ||
$plugin_launcher_path = dirname( __DIR__ ) . '/'; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound | ||
|
||
return [ | ||
'plugin_name' => $plugin_name, | ||
'plugin_slug' => sanitize_key( $plugin_name ), | ||
'plugin_version' => '1.0.0', | ||
'plugin_launcher_file' => $plugin_launcher_path . '/' . basename($plugin_launcher_path) . '.php', | ||
'plugin_launcher_path' => $plugin_launcher_path, | ||
'plugin_inc_path' => realpath( $plugin_launcher_path . 'inc/' ) . '/', | ||
'prefix' => 'launchpad_', | ||
'translation_key' => 'launchpad', | ||
'is_mu_plugin' => false, | ||
'plugin_name' => $plugin_name, | ||
'plugin_slug' => sanitize_key( $plugin_name ), | ||
'plugin_version' => '1.0.0', | ||
'plugin_launcher_file' => $plugin_launcher_path . '/' . basename( $plugin_launcher_path ) . '.php', | ||
'plugin_launcher_path' => $plugin_launcher_path, | ||
'plugin_inc_path' => realpath( $plugin_launcher_path . 'inc/' ) . '/', | ||
'prefix' => 'launchpad_', | ||
'translation_key' => 'launchpad', | ||
'is_mu_plugin' => false, | ||
]; |
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,7 +1,8 @@ | ||
<?php | ||
namespace Launchpad\Configs; | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
return [ | ||
\Launchpad\ServiceProvider::class, | ||
\Launchpad\ServiceProvider::class, | ||
]; |
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
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,71 @@ | ||
<?xml version="1.0"?> | ||
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WP Rocket" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"> | ||
<description>The custom ruleset for Launchpad.</description> | ||
|
||
<!-- For help in understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml --> | ||
<!-- For help in using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage --> | ||
|
||
<!-- ** WHAT TO SCAN ** --> | ||
|
||
<file>.</file> | ||
<!-- Ignoring Files and Folders: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders --> | ||
<exclude-pattern>/inc/deprecated/*</exclude-pattern> | ||
<exclude-pattern>/vendor-prefixed/*</exclude-pattern> | ||
<exclude-pattern>/tests/*</exclude-pattern> | ||
<exclude-pattern>/vendor/*</exclude-pattern> | ||
<exclude-pattern>/node_modules/*</exclude-pattern> | ||
|
||
<!-- ** HOW TO SCAN ** --> | ||
|
||
<arg value="sp"/><!-- Show sniff and progress --> | ||
<arg name="colors"/><!-- Show results with colors --> | ||
<arg name="parallel" value="50"/><!-- Enables parallel processing when available for faster results. --> | ||
<arg name="extensions" value="php"/><!-- Limit to PHP files --> | ||
|
||
<!-- Rules: Check PHP version compatibility - see https://github.com/PHPCompatibility/PHPCompatibilityWP --> | ||
<rule ref="PHPCompatibility"/> | ||
|
||
<rule ref="WordPress"> | ||
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma"/> | ||
<exclude name="Generic.PHP.NoSilencedErrors.Discouraged"/> | ||
<exclude name="PEAR.Functions.FunctionCallSignature.Indent"/> | ||
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/> | ||
<exclude name="Squiz.Commenting.FileComment.Missing"/> | ||
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag"/> | ||
<exclude name="Squiz.PHP.CommentedOutCode.Found"/> | ||
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" /> | ||
<exclude name="Generic.Arrays.DisallowShortArraySyntax" /> | ||
</rule> | ||
<rule ref="WordPress.WP.I18n"> | ||
<properties> | ||
<property name="text_domain" type="array" value="launchpad" /> | ||
</properties> | ||
</rule> | ||
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"> | ||
<properties> | ||
<property name="prefixes" type="array" value="launchpad_,Launchpad" /> | ||
</properties> | ||
</rule> | ||
<rule ref="WordPress.Files.FileName"> | ||
<properties> | ||
<property name="strict_class_file_names" value="false" /> | ||
</properties> | ||
</rule> | ||
|
||
|
||
<rule ref="WordPress-Docs"> | ||
<exclude name="Squiz.Commenting.FileComment.Missing"/> | ||
<exclude name="Squiz.Commenting.ClassComment.Missing"/> | ||
</rule> | ||
|
||
<!-- Rules: WordPress Coding Standards - see | ||
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards | ||
WordPress-Extra includes WordPress-Core --> | ||
<rule ref="WordPress-Extra"> | ||
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/> | ||
<exclude name="WordPress.PHP.DisallowShortTernary.Found"/> | ||
</rule> | ||
|
||
<!-- Enforce short array syntax: `[]` in place of `array()`. --> | ||
<rule ref="Generic.Arrays.DisallowLongArraySyntax" /> | ||
</ruleset> |