WordPress.org

Make WordPress Core

Opened 7 days ago

Closed 6 days ago

Last modified 43 hours ago

#44366 closed enhancement (fixed)

Update PHPCS ruleset for WP Core and related Composer setup

Reported by: jrf Owned by: jrf
Milestone: 5.0 Priority: normal
Severity: normal Version: trunk
Component: Build/Test Tools Keywords: has-patch
Focuses: coding-standards Cc:

Description

This update the core native PHPCS ruleset

.gitignore:

  • Add the typical filenames of overloaded PHPCS configs to .gitignore.

Composer:

  • Use the develop (Packagist dev-master) version of WPCS as it contains lots of bugfixes.
  • Remove the PHPCS dependency. This is a dependency of WPCS, not of WP Core itself. This will also make sure that the PHPCS version used is always one which is supported by WPCS.
  • Refreshed the composer.lock file.

PHPCS ruleset:

  • Comment out a reference to a sniff which doesn't exist in WPCS yet (for now).
  • Use the PHPCS 3.x basepath option to clean up the file paths PHPCS shows in the reports.
  • Use the PHPCS 3.x parallel option to enable parallel scanning whenever possible to speed up the scans.
  • Whitelist the wp-includes/I18n.php file from issues being reported by the WordPress.WP.I18n sniff.

Attachments (1)

44366.patch (6.2 KB) - added by jrf 7 days ago.

Download all attachments as: .zip

Change History (5)

@jrf
7 days ago

#1 @jrf
6 days ago

  • Owner set to jrf
  • Resolution set to fixed
  • Status changed from new to closed

In 43348:

Build/Tools: Update PHPCS ruleset for WP Core and related Composer setup.

.gitignore + svn:ignore:

  • Add the typical filenames of overloaded PHPCS configs to .gitignore.

Composer:

  • Use the develop (Packagist dev-master) version of WPCS as it contains lots of bugfixes.
  • Remove the PHPCS dependency. This is a dependency of WPCS, not of WP Core itself. This will also make sure that the PHPCS version used is always one which is supported by WPCS.
  • Refreshed the composer.lock file.

PHPCS ruleset:

  • Removed a reference to a sniff which doesn't exist in WPCS yet.
  • Use the PHPCS 3.x basepath option to clean up the file paths PHPCS shows in the reports.
  • Use the PHPCS 3.x parallel option to enable parallel scanning whenever possible to speed up the scans.
  • Whitelist the wp-includes/l10n.php file from issues being reported by the WordPress.WP.I18n sniff.

Fixes #44366.

#2 @jrf
6 days ago

  • Component changed from General to Build/Test Tools
  • Milestone changed from Awaiting Review to 5.0

#3 @GaryJ
43 hours ago

Use the develop (Packagist dev-master) version of WPCS as it contains lots of bugfixes.

The composer.lock is showing that this is now pointing to https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/commit/cf6b310caad735816caef7573295f8a534374706 which is the 0.14.1 release.

Was this intended, or should it have been the dev-develop branch (https://packagist.org/packages/wp-coding-standards/wpcs#dev-develop)?

#4 @GaryJ
43 hours ago

Also, there appears to be a typo: "simultanously" should be "simultaneously"

Note: See TracTickets for help on using tickets.