-
-
Notifications
You must be signed in to change notification settings - Fork 494
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.1 #1855
Merged
Release version 2.2.1 #1855
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closure `use` parentheses do not have a parenthesis owner. While this is a plaster on the wound as the sniff really needs to be split up, for now, it fixes the notice. Fixes 1792
As [PHP 7.4 has been released](https://www.php.net/archive/2019.php#2019-11-28-1), the build against PHP 7.4 should no longer be allowed to fail. Includes fixing the `language` setting. This can't be an array and thrown warnings as it was when the Travis script is validated.
Travis: don't allow PHP 7.4 build to fail
Add metrics to make it easier for people to decide whether or not to en/disable this rule. The generated metrics will look like this and can be called up using `--report=info`: ``` PHP CODE SNIFFER INFORMATION REPORT ---------------------------------------------------------------------- Multi-line array - comma after last item: no => 2,064 ( 95.82%) yes => 90 ( 4.18%) ------------------------- total => 2,154 (100.00%) Single line array - comma after last item: 0 [804/804, 100%] ```
…spacing-closure-use-return-type ControlStructureSpacing: fix undefined index error
…dd-metrics CommaAfterArrayItem: add metrics for comma after last item
The metrics for this sniff would be different depending on whether or not a (custom/default) whitelist was used. If `use_default_whitelist` was set to `false` and no custom whitelist was passed, the metrics would look something like this: ``` Error silencing: @Header( 'Content-Type: ' ... => 1 ( 12.50%) @Header( 'Content-type: application/json' ... => 1 ( 12.50%) @Header( 'X-Robots-Tag: noindex' ... => 1 ( 12.50%) @ignore_user_abort( true ... => 1 ( 12.50%) @include_once $converter_file... => 1 ( 12.50%) @ini_get( 'disable_functions' ... => 1 ( 12.50%) @ini_set( $key,... => 1 ( 12.50%) @is_file( $this->... => 1 ( 12.50%) ------------------------------------------------------------- total => 8 (100.00%) ``` ... while if `use_default_whitelist` was set to `true` òr a custom whitelist was passed, those same metrics would look something like this: ``` PHP CODE SNIFFER INFORMATION REPORT ---------------------------------------------------------------------- Error silencing: header => 3 ( 37.50%) @include_once $converter_file... => 1 ( 12.50%) ignore_user_abort => 1 ( 12.50%) ini_get => 1 ( 12.50%) ini_set => 1 ( 12.50%) whitelisted function call: is_file => 1 ( 12.50%) -------------------------------------------------- total => 8 (100.00%) ---------------------------------------------------------------------- ``` The change now made will make it so: * the grouping by function will always happen; * function calls will consistently be prefixed with a `@`, unless whitelisted, in which case they are prefixed with `whitelisted function call: ` (like before). The improved metrics will look something like this: ``` PHP CODE SNIFFER INFORMATION REPORT ---------------------------------------------------------------------- Error silencing: @Header => 3 ( 37.50%) @ignore_user_abort => 1 ( 12.50%) @include_once $converter_file... => 1 ( 12.50%) @ini_get => 1 ( 12.50%) @ini_set => 1 ( 12.50%) whitelisted function call: is_file => 1 ( 12.50%) -------------------------------------------------- total => 8 (100.00%) ---------------------------------------------------------------------- ```
Looks like Travis (finally) has got a "normal" PHP 7.4 image available. While we're at it, let's add a build against `nightly` (PHP 8) back which is allowed to fail.
NoSilencedErrors: improve consistency metrics
Travis: test against PHP 7.4, not snapshot
Includes a unit test for issue #1847
Fix off-by-one error when $treat_files_as_scoped is true
…_color to the list of escaping functions. Fixes #1846
The DealerDirect Composer plugin has just released version `0.6.0`. As Composer treats minors < 1.0 as majors, updating to this version requires an update to the `composer.json` requirements. > For pre-1.0 versions it also acts with safety in mind and treats `^0.3` as `>=0.3.0 <0.4.0`. Refs: * https://github.com/Dealerdirect/phpcodesniffer-composer-installer/releases/tag/v0.6.0 * https://getcomposer.org/doc/articles/versions.md#caret-version-range-
dingo-d
approved these changes
Jan 30, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…y-suggestion Update suggested version of Composer PHPCS plugin
When a function call to one of the singular/plural text translation functions - like `_n_noop()` - is missing an argument, the sniff would still try an execute the `compare_single_and_plural_arguments()` check and on PHP 7.4 would generate a "Trying to access array offset on value of type null" error which would stop the PHPCS run dead with an `Internal.Exception` error code. Fixed by skipping the check in that case. The missing argument should be reported by the preceding `check_argument_tokens()` check anyhow. Includes unit test.
Let sanitize_hex_color() count as an escape function
I18n: bug fix - trying to access array offset on null (PHP 7.4)
* Release date set at this **Tuesday February 4rd**. * Includes all currently merged changes.
GaryJones
approved these changes
Feb 3, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than merging in the changelog, the rest LGTM.
Changelog for WPCS 2.2.1
Release tweet: https://twitter.com/jrf_nl/status/1224532538028429314 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please do add approvals if you agree as otherwise I won't be able to release.
PR for tracking changes for the 2.2.1 release. Target release date:
Sunday February 2Tuesday February 4.DeprecatedFunctions
and the other deprecated WP feature sniffs need updating and if so, action it - N/Amaster
(careful, GH defaults todevelop
!) & copy & paste the changelog to itOpen PR to mergemaster
intodevelop
to get rid of the This branch is out-of-date with the base branch messages on each release. (only after major releases)