WordPress.org

Make WordPress Core

Changeset 45665 for trunk/phpcs.xml.dist


Ignore:
Timestamp:
07/19/2019 07:47:16 AM (5 months ago)
Author:
pento
Message:

Coding Standards: Move the remaining PHPCS errors to report as warnings, and add Travis tests.

The remaining error-level coding standards issues (specifically, associated with the sniffs WordPress.PHP.YodaConditions.NotYoda, WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQL.NotPrepared, and WordPress.Files.FileName.InvalidClassFileName) are marked as warnings, until they're all addressed.

This change allows us to run linting on Travis across the entire codebase, ensuring no other error-level violations can be introduced.

Additionally, PHPCS will now cache results locally, drastically improving performance for subsequent checks: scanning the entire codebase takes 1-2 minutes the first time, and less than one second for subsequent checks.

See #47632.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpcs.xml.dist

    r45664 r45665  
    55    <rule ref="WordPress-Core"/>
    66    <rule ref="WordPress.CodeAnalysis.EmptyStatement"/>
     7
     8    <!-- These rules are being set as warnings instead of errors, so we can error check the entire codebase. -->
     9    <rule ref="WordPress.PHP.YodaConditions.NotYoda">
     10        <type>warning</type>
     11    </rule>
     12    <rule ref="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase">
     13        <type>warning</type>
     14    </rule>
     15    <rule ref="WordPress.DB.PreparedSQL.InterpolatedNotPrepared">
     16        <type>warning</type>
     17    </rule>
     18    <rule ref="WordPress.DB.PreparedSQL.NotPrepared">
     19        <type>warning</type>
     20    </rule>
     21    <rule ref="WordPress.Files.FileName.InvalidClassFileName">
     22        <type>warning</type>
     23    </rule>
    724
    825    <rule ref="WordPress.NamingConventions.ValidVariableName">
Note: See TracChangeset for help on using the changeset viewer.