Skip to content

Instantly share code, notes, and snippets.

@iqbalrony
Last active January 6, 2022 11:58
Show Gist options
  • Select an option

  • Save iqbalrony/97b68240ddea209008d7218fd938bff3 to your computer and use it in GitHub Desktop.

Select an option

Save iqbalrony/97b68240ddea209008d7218fd938bff3 to your computer and use it in GitHub Desktop.

Revisions

  1. iqbalrony revised this gist Jan 6, 2022. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions ruleset.xml
    Original file line number Diff line number Diff line change
    @@ -21,15 +21,22 @@
    <exclude-pattern>*/js/*</exclude-pattern>
    <exclude-pattern>*/style.css</exclude-pattern>

    <!-- StrictComparisons rull modified -->
    <rule ref="WordPress.PHP.StrictComparisons">
    <severity>2|3</severity>
    </rule>

    <rule ref="WordPress-Extra">
    <exclude name="WordPress.Arrays.ArrayDeclarationSpacing"/>
    <exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
    <exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
    <!-- <exclude name="WordPress.NamingConventions.ValidHookName"/> -->
    <exclude name="WordPress.NamingConventions.ValidHookName.NotLowercase"/>
    <exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/>

    <exclude name="Generic.Commenting.DocComment.MissingShort" />
    <exclude name="Generic.Formatting.MultipleStatementAlignment" />
    <!-- <exclude name="Generic.Formatting.MultipleStatementAlignment" /> -->
    <!-- <exclude name="WordPress.Arrays.MultipleStatementAlignment" /> -->
    <exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
    <exclude name="Squiz.Commenting.ClassComment.Missing" />
    <exclude name="Squiz.Commenting.FileComment.Missing" />
    @@ -40,7 +47,6 @@
    <exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterOpen" />
    <exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeEnd" />
    <exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterEnd" />
    <exclude name="WordPress.Arrays.MultipleStatementAlignment" />
    <exclude name="WordPress.CSRF.NonceVerification.NoNonceVerification" />
    <!-- <exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped"/>
    <exclude name="WordPress.Security.EscapeOutput.UnsafePrintingFunction" /> -->
  2. iqbalrony revised this gist Jan 5, 2022. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions ruleset.xml
    Original file line number Diff line number Diff line change
    @@ -25,6 +25,7 @@
    <exclude name="WordPress.Arrays.ArrayDeclarationSpacing"/>
    <exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
    <exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
    <exclude name="WordPress.NamingConventions.ValidHookName.NotLowercase"/>
    <exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/>

    <exclude name="Generic.Commenting.DocComment.MissingShort" />
    @@ -71,8 +72,12 @@
    <!-- Text Domain -->
    <rule ref="WordPress.WP.I18n">
    <properties>
    <property name="text_domain" type="array" value="text-domain"/>
    <property name="text_domain" type="array" value="text-domain2"/>
    <property name="text_domain" type="array">
    <element key="plugins/happy-elementor-addons" value="happy-elementor-addons"/>
    <element key="plugins/happy-elementor-addons-pro" value="happy-addons-pro"/>
    <element key="plugins/eazygrid-elementor" value="eazygrid-elementor"/>
    <element key="plugins/eazyfilter" value="eazyfilter"/>
    </property>
    </properties>
    </rule>

  3. iqbalrony revised this gist Jan 5, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions ruleset.xml
    Original file line number Diff line number Diff line change
    @@ -71,8 +71,8 @@
    <!-- Text Domain -->
    <rule ref="WordPress.WP.I18n">
    <properties>
    <property name="text_domain" type="array" value="happy-elementor-addons"/>
    <property name="text_domain" type="array" value="happy-addons-pro"/>
    <property name="text_domain" type="array" value="text-domain"/>
    <property name="text_domain" type="array" value="text-domain2"/>
    </properties>
    </rule>

  4. iqbalrony created this gist Jan 5, 2022.
    79 changes: 79 additions & 0 deletions ruleset.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,79 @@
    <?xml version="1.0"?>
    <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="IqbalRony-Custom" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">

    <!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
    <!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress-Core/ruleset.xml -->

    <!-- Set a description for this ruleset. -->
    <description>IqbalRony Custom Coding Standards</description>

    <arg name="parallel" value="8" />

    <!-- Exclude paths -->
    <exclude-pattern>src/</exclude-pattern>
    <exclude-pattern>build/</exclude-pattern>
    <exclude-pattern>assets/</exclude-pattern>
    <exclude-pattern>images/</exclude-pattern>
    <exclude-pattern>*/i18n/*</exclude-pattern>
    <exclude-pattern>*/node_modules/*</exclude-pattern>
    <exclude-pattern>*/vendor/*</exclude-pattern>
    <exclude-pattern>*/css/*</exclude-pattern>
    <exclude-pattern>*/js/*</exclude-pattern>
    <exclude-pattern>*/style.css</exclude-pattern>

    <rule ref="WordPress-Extra">
    <exclude name="WordPress.Arrays.ArrayDeclarationSpacing"/>
    <exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
    <exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
    <exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/>

    <exclude name="Generic.Commenting.DocComment.MissingShort" />
    <exclude name="Generic.Formatting.MultipleStatementAlignment" />
    <exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
    <exclude name="Squiz.Commenting.ClassComment.Missing" />
    <exclude name="Squiz.Commenting.FileComment.Missing" />
    <exclude name="Squiz.Commenting.FunctionComment.Missing" />
    <exclude name="Squiz.Commenting.FunctionComment.MissingParamComment" />
    <exclude name="Squiz.Commenting.VariableComment.Missing" />
    <exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeOpen" />
    <exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterOpen" />
    <exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeEnd" />
    <exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterEnd" />
    <exclude name="WordPress.Arrays.MultipleStatementAlignment" />
    <exclude name="WordPress.CSRF.NonceVerification.NoNonceVerification" />
    <!-- <exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped"/>
    <exclude name="WordPress.Security.EscapeOutput.UnsafePrintingFunction" /> -->
    <exclude name="WordPress.Security.NonceVerification.NoNonceVerification"/>
    <exclude name="WordPress.Security.NonceVerification.Missing"/>
    <exclude name="WordPress.WP.I18n.MissingTranslatorsComment" />
    <exclude name="WordPress.WP.I18n.NonSingularStringLiteralSingle" />
    <exclude name="WordPress.WP.I18n.NonSingularStringLiteralPlural" />
    <!-- <exclude name="WordPress.XSS.EscapeOutput.OutputNotEscaped" /> -->
    <exclude name="WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet" />
    <exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
    <exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" />
    <exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
    <exclude name="Generic.Arrays.DisallowLongArraySyntax.Found"/>
    </rule>

    <rule ref="WordPress.WP.DeprecatedFunctions">
    <properties>
    <property name="minimum_supported_version" value="4.7" />
    </properties>
    </rule>

    <rule ref="WordPress.NamingConventions.ValidHookName">
    <properties>
    <property name="additionalWordDelimiters" value="/-" />
    </properties>
    </rule>

    <!-- Text Domain -->
    <rule ref="WordPress.WP.I18n">
    <properties>
    <property name="text_domain" type="array" value="happy-elementor-addons"/>
    <property name="text_domain" type="array" value="happy-addons-pro"/>
    </properties>
    </rule>

    </ruleset>