Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version 2.2.0 #1828

Merged
merged 122 commits into from Nov 11, 2019
Merged

Release version 2.2.0 #1828

merged 122 commits into from Nov 11, 2019

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 1, 2019

⚠️ DO NOT MERGE (YET) ⚠️

PR for tracking changes for the 2.2.0 release. Target release date: Monday November 11.

jrfnl and others added 30 commits May 22, 2019 11:14
Travis now offers stages. Using stages we can:
- Run the code style related checks before running any unit tests and stop the build early if any are detected.
- Remove the duplicate unit test runs - i.e. previously we had an extra (third) build against PHP 7.2 (now changed to 7.3) which would run the code style related checks, but would also re-run the unit tests. This extra build will now no longer run the unit tests.

While this does mean that the unit tests will run with a slight delay (the `Sniff` and `Rulesets` stages have to finish before they start), it also means that we:
* Get code style errors reported earlier as it's been moved to be the first stage and the build will just stop if any are found.
* We won't be wasting Travis's resources on builds which will have to be re-run anyway.

Ref: https://docs.travis-ci.com/user/build-stages/

Note that `Allowed failures` is no longer listed as a separate block in the Travis result overview, but is _is_ respected.

For more discussion about this:
* travis-ci/travis-ci#7789
* https://travis-ci.community/t/always-show-allow-failures-allowed-failures-when-build-stages-are-used/217
* https://travis-ci.community/t/work-out-kinks-in-interactions-between-stages-allow-fail-and-fast-finish/1090
* travis-ci/travis-ci#9677
…ges (#1711)

Travis: run the code style related and ruleset checks in separate stages

Co-authored-by: Stephen Edgar <stephen@netweb.com.au>
String array keys for variable array access would also be examined as part of the hook name, while those should be skipped over as they are not part of the _hook_name.

This fixes that.

Includes unit test.

This commit also lowers the nesting level of the loop by continuing early whenever possible.
…dhookname-bugfix

ValidHookName: bug fix  / skip over array keys
Add RECOVERY_MODE_COOKIE to whitelisted core constants
The repo has moved organization within GitHub.
Composer: Update repo URL references
The "quicktest" stage will only run a CS check, ruleset check, linting and the unit tests against low/high PHP/PHPCS combinations. This should catch most issues.

The more comprehensive complete build against a larger combination of PHP/PHPCS combination will now only be run on PRs and merges to `develop`/`master`.
…d-stage

Travis: add "quicktest" stage for non-PR/merge builds
As this sniff is already included in the WP Core ruleset and the enhancement request is about PHP native functions, this seemed liked a logical sniff to add this to.

I've elected to make this an `error` instead of a `warning` as the code within WP Core has been cleaned up for this issue now and it would be good to prevent new instances of `date()` creeping in.

Fixes 1713
…ctions-add-date

RestrictedPHPFunctions: add error for use of date()
The GitHub repository has moved from the dedicated `WordPress-Coding-Standards` organisation to the `WordPress` organisation.

This:
* Updates all links which pointed to the old repo on GH to the new one.
* Updates the badges in the Readme to pick up things up correctly again for the new repo.
* Updated all links to Travis from `.org` to `.com` as the build CI has moved as well.
Add `$plugin` to the list of global variables that shouldn't be overridden
Added remaining plugin load globals
Rulesets are processed top-to-bottom, one rule at the time.

For the `WordPress` ruleset, this means that PHPCS would first load the `WordPress-Core` ruleset and process all rules in that file, then read the `WordPress-Docs` ruleset and lastly, the `WordPress-Extra` ruleset.

As the `WordPress-Extra` ruleset includes `WordPress-Core`, it would re-process the `WordPress-Core` ruleset a second time and then process the additional rules in the `Extra` ruleset.

This means that in effect, the `WordPress-Core` ruleset is processed twice when using the `WordPress` ruleset which is inefficient.

By commenting that rule out, we still document that the `WordPress` ruleset includes `WordPress-Core` without double processing the ruleset.
Adds documentation for the WordPress.WhiteSpace.CastStructureSpacing

Related to #1722
Adds documentation for the WordPress.WhiteSpace.PrecisionAlignmentSniff

Related to #1722
Adds documentation for the WordPress.WhiteSpace.DisallowInlineTabs sniff

Related to #1722
… in combination with a spread operator

Includes updated docs.

Related 1762
Related 1524
This new sniff addresses the new "_The short ternary operator must not be used._" rule which was recently added to the handbook.

The sniff has been added to the `WordPress-Core` ruleset.

Refs:
* https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#ternary-operator
* https://make.wordpress.org/core/2019/07/12/php-coding-standards-changes/

Includes unit tests.
Includes documentation.
Recently a new section has been added to the handbook which forbids the use of short arrays.

> Using long array syntax ( array( 1, 2, 3 ) ) for declaring arrays is generally more readable than short array syntax ( [ 1, 2, 3 ] ), particularly for those with vision difficulties. Additionally, it’s much more descriptive for beginners.
>
> Arrays must be declared using long array syntax.

https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#declaring-arrays

This PR add an existing upstream sniff which addresses this.
Includes auto-fixer.

Also see: https://make.wordpress.org/core/2019/07/12/php-coding-standards-changes/

Loosely related to 764
jrfnl and others added 5 commits October 28, 2019 01:40
* Trim whitespace off the "expected" and "found" values which are used in the error messages.
* Ignore comments and PHPCS annotations when building up the "expected" and "found" values.
* Improve line precision by throwing the error on the line where the hook name starts, not the line containing the function call.

Includes unit test.

The unit test basically only tests part 3 of the change. The error message improvement needs visual inspection as the message content is not tested.
Similar to 1815, but then for the `PrefixAllGlobals` sniff, allowing it to fail earlier for calls to deprecated hooks.
…-error-messages

ValidHookName: improve error messages
…tamp-sniff

New DateTime.CurrentTimeTimestamp sniff
PrefixAllGlobals: minor efficiency tweak
@jrfnl jrfnl added this to the 2.2.0 milestone Nov 1, 2019
jrfnl and others added 14 commits November 1, 2019 08:55
What with the target release date for WPCS 2.2.0 being November 11 and the target release date of WP 5.3 being November 12, updating this property before the release is probably a good idea.
Update WordPress/Docs/WP/CronIntervalStandard.xml

Co-Authored-By: Juliette <663378+jrfnl@users.noreply.github.com>

Update WordPress/Docs/WP/CronIntervalStandard.xml

Co-Authored-By: Juliette <663378+jrfnl@users.noreply.github.com>

Update WordPress/Docs/WP/CronIntervalStandard.xml

Co-Authored-By: Juliette <663378+jrfnl@users.noreply.github.com>

Update WordPress/Docs/WP/CronIntervalStandard.xml

Co-Authored-By: Juliette <663378+jrfnl@users.noreply.github.com>

Update WordPress/Docs/WP/CronIntervalStandard.xml

Co-Authored-By: Juliette <663378+jrfnl@users.noreply.github.com>

Seperates function definition
Adds a new `WordPress.NamingConventions.ValidPostTypeSlug` sniff.

Checks if the first parameter given to a register_post_type() call is actually a valid value.
…sion-property

Update default minimum supported WP version
Adds documentation for WordPress.WP.CronInterval
... picked up along the way.
Various minor documentation fixes
…dResources

Adds documentation for WordPress.WP.EnqueuedResources.
Adds WP.Security.SafeRedirect documentation.
@jrfnl jrfnl requested a review from a team November 7, 2019 19:34
* Release date set at this **Monday November 11th**.
* Includes all currently merged changes.
@jrfnl
Copy link
Member Author

jrfnl commented Nov 11, 2019

@WordPress/wpcs Could I have some approval(s) please ?

@jrfnl jrfnl merged commit f90e869 into master Nov 11, 2019
@jrfnl
Copy link
Member Author

jrfnl commented Nov 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet