-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
CS/QA: various minor fixes #44551
CS/QA: various minor fixes #44551
Conversation
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.
LGTM! 👍
Just for my understanding - in what way does it help mergeability with core? Are the coding styles somehow incompatible between Gutenberg and Core?
There are a number of standards for Core, which are applied in Core, but aren't actively enforced via tooling at this time. Note: as of the upcoming WPCS 3.0.0 a lot of those standards which are currently not (yet) enforced, will start to get enforced, so this also sets the GB project up to be more prepared for WPCS 3.0.0. |
@michalczaplinski I notice the PR shows a conflict by now - what is the convention for handling this in this repo ? I would normally do a local rebase without additional changes and force push to the branch. Is that okay ? |
Yeah, that's fine! The commits get squashed anyway when you merge your PR 🙂 Thanks for your explanation about coding styles, makes sense to me. A complete aside: In the long term, I would love to see those kind of changes enforced via tooling. I'd be happy with whatever code style as long as the code can be formatted automatically. |
And that's exactly what WPCS will start to do. ;-) (as of version 3.0.0) |
7ef97a2
to
fff668c
Compare
Rebased without changes to get past an imaginary merge conflict. |
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.
LGTM!
Good job.
P.S. There is one failing e2e test, but I guess it is unrelated to the fixes in this PR. I've restarted the CI checks. Hopefully, the error will gone.
fff668c
to
ffa8cf9
Compare
I rebased this PR last Friday and it fixed the issue with the e2e test. |
Replaces `+=` and `-=` with `++$t` and `--$t` (in/decrementors) within the `wp_tinycolor_hue_to_rgb()`. Why? For performance: in/decrementors are more performant than an assignment with a calculation. References: * https://www.php.net/manual/en/language.operators.increment.php * WordPress/gutenberg#44551 Follow-up to [50929]. Props jrf, czapla, antonvlasenko, aristath, mamaduka. See #57527. git-svn-id: https://develop.svn.wordpress.org/trunk@55140 602fd350-edb4-49c9-b593-d223f7449a82
Replaces `+=` and `-=` with `++$t` and `--$t` (in/decrementors) within the `wp_tinycolor_hue_to_rgb()`. Why? For performance: in/decrementors are more performant than an assignment with a calculation. References: * https://www.php.net/manual/en/language.operators.increment.php * WordPress/gutenberg#44551 Follow-up to [50929]. Props jrf, czapla, antonvlasenko, aristath, mamaduka. See #57527. Built from https://develop.svn.wordpress.org/trunk@55140 git-svn-id: http://core.svn.wordpress.org/trunk@54673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Replaces `+=` and `-=` with `++$t` and `--$t` (in/decrementors) within the `wp_tinycolor_hue_to_rgb()`. Why? For performance: in/decrementors are more performant than an assignment with a calculation. References: * https://www.php.net/manual/en/language.operators.increment.php * WordPress/gutenberg#44551 Follow-up to [50929]. Props jrf, czapla, antonvlasenko, aristath, mamaduka. See #57527. Built from https://develop.svn.wordpress.org/trunk@55140 git-svn-id: https://core.svn.wordpress.org/trunk@54673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Replaces `+=` and `-=` with `++$t` and `--$t` (in/decrementors) within the `wp_tinycolor_hue_to_rgb()`. Why? For performance: in/decrementors are more performant than an assignment with a calculation. References: * https://www.php.net/manual/en/language.operators.increment.php * WordPress/gutenberg#44551 Follow-up to [50929]. Props jrf, czapla, antonvlasenko, aristath, mamaduka. See #57527. Built from https://develop.svn.wordpress.org/trunk@55140 git-svn-id: http://core.svn.wordpress.org/trunk@54673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What?
Various small CS/QA fixes.
Why?
To improve compatibility/mergability with WP Core.
How?
Removes a space in a place where there shouldn't be a space.
The semi-colon effectively created a new, empty PHP statement, where none was needed.
Using in/decrementors is more performant than an assignment with a calculation.
Every concatenation exponentially increases the memory needed for the string in PHP, so this removes unnecessary concatenations, i.e. two hard-coded strings being concatenated.