Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#45956 closed task (blessed) (fixed)

Upgrade WPCS to 1.2.1

Reported by: pento's profile pento Owned by: pento's profile pento
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: coding-standards Cc:

Description (last modified by pento)

By upgrading WPCS to 1.2.1:

  • Generic.PHP.NoSilencedErrors.Discouraged is replaced by WordPress.PHP.NoSilencedErrors.Discouraged, which whitelists 123 instances of errors being appropriately silenced.
  • Autofix 191 violations of Generic.WhiteSpace.ScopeIndent.
  • Fix 6 false positives in WordPress.WhiteSpace.PrecisionAlignment.Found.
  • The allowMultipleArguments property of PEAR.Functions.FunctionCallSignature defaults to false, so we can remove that custom setting from phpcs.xml.dist.

By upgrading PHPCS to 3.4.1:

  • Fix 23 false positives in Squiz.PHP.DisallowMultipleAssignments.Found

Attachments (1)

45956.diff (47.3 KB) - added by pento 5 years ago.

Download all attachments as: .zip

Change History (4)

#1 @pento
5 years ago

  • Description modified (diff)

5 years ago

#2 @pento
5 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 44574:

Coding Standards: Upgrade WPCS to 1.2.1.

This upgrade fixes quite a few false positives, as well as auto-fixing some indenting issues.

Fixes #45956.

#3 @jrf
5 years ago

Just FYI: PHPCS 3.4.1 is not (yet) released. The latest released version is 3.4.0.

On another note, WPCS 2.0.0 is expected to be released within the week.
Upgrading will involve updating some of the error codes used in the inline whitelist comments (mostly those just added for variabe names) as well as in the ruleset.

I expect the upgrade will throw only a few new errors, all of which I expect to be auto-fixable (for typecasts).

For more information, see the changelog of the WPCS 2.0.0-RC1 release.

Note: See TracTickets for help on using tickets.