#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: | 5.1 |
Component: | Build/Test Tools | Keywords: | has-patch commit |
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
(Packagistdev-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 theWordPress.WP.I18n
sniff.
Attachments (2)
Change History (12)
#2
@
6 years ago
- Component changed from General to Build/Test Tools
- Milestone changed from Awaiting Review to 5.0
#3
@
6 years ago
Use the
develop
(Packagistdev-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)?
#6
@
6 years ago
- Milestone changed from 5.1 to 5.0
- Resolution fixed deleted
- Status changed from closed to reopened
As part of adding PHPCS to the 5.0 branch reopening and moving back to the 5.0 milestone
#7
@
6 years ago
- Keywords commit added
Patch 44366-50branch.diff for the 5.0 branch is ready for commit
Note: The patch includes the changes for svn:ignore
, highly unlikely it will applied when applying the patch though.
To edit svn:ignore
run svn propedit svn:ignore .
from the command line and add phpcs.xml
and .phpcs.xml
after phpunit.xml
Index: . =================================================================== --- . (revision 43735) +++ . (working copy) Property changes on: . ___________________________________________________________________ Modified: svn:ignore ## -5,9 +5,11 ## # Files and folders related to build/test tools phpunit.xml +phpcs.xml +.phpcs.xml node_modules npm-debug.log build wp-cli.local.yml .git jsdoc
#8
@
6 years ago
Patch 44366-50branch.diff is based on [43348] for backporting to the 5.0 branch
It also includes recent phpcs.xml.dist
changes from:
It also includes recent composer.json
/composer-lock.json
changes from:
I've not re-opened the above 6 tickets for the 5.0 milestone, committers choice to reference these during commit
In 43348: