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

Updated PHPCS: Packages and Debugger #17617

Merged
merged 1 commit into from
Oct 28, 2020
Merged

Updated PHPCS: Packages and Debugger #17617

merged 1 commit into from
Oct 28, 2020

Conversation

kraftbj
Copy link
Contributor

@kraftbj kraftbj commented Oct 26, 2020

After #17406, updated the "requiredlist" files to match new PHPCS rules for packages and the debugger.

Changes proposed in this Pull Request:

  • PHPCS

Jetpack product discussion

n/a

Does this pull request change what data or activity we track or use?

n/a

Testing instructions:

n/a

Proposed changelog entry for your changes:

  • n/a

Copy link

@test-case-reminder test-case-reminder bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some suggested test cases for this PR.

Connection

  • In-place connection with free plan
  • In-place connection with paid plan
  • In-place connection with product purchase
  • Classic connection. Use Safari, or set a constant JETPACK_SHOULD_NOT_USE_CONNECTION_IFRAME to true
  • Disconnect/reconnect connection
  • Secondary user connection
  • Connection on multisite

Verify that the changes are compatible with the plugins that use the connection package.

  • WooCommerce Payments
  • Jetpack Boost
  • Previous versions of Jetpack

If you think that suggestions should be improved please edit the configuration file here. You can also modify/add test-suites to be used in the configuration file.

@github-actions github-actions bot added [Status] Needs Package Release This PR made changes to a package. Let's update that package now. labels Oct 26, 2020
@kraftbj
Copy link
Contributor Author

kraftbj commented Oct 26, 2020

After 9.1 branches off and #17406 merges, we need to update base branch to master, then this can be merged.

@anomiex
Copy link
Contributor

anomiex commented Oct 27, 2020

After 9.1 branches off and #17406 merges, we need to update base branch to master, then this can be merged.

Once #17406 merges and its branch is deleted, Github will automatically set the base branch to master (or whatever we're calling it by then).

anomiex
anomiex previously approved these changes Oct 27, 2020
Copy link
Contributor

@anomiex anomiex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look sane to me. None of the comments I left are anything I'd hold up approval on.

@@ -156,7 +155,7 @@ public function test_jetpack_constants_get_constant_use_filter_value() {
$apply_filters_spy = new Spy(
'Automattic\Jetpack',
'apply_filters',
function ( $filter_name, $value, $name ) use ( $test_constant_value ) {
function ( $filter_name, $value, $name ) use ( $test_constant_value ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could just remove the unused variables here, if you want.

I wouldn't recommend that for actual methods intended for being passed as callbacks, but this is just a closure.

@@ -62,11 +62,11 @@ public function test_store_error() {

$stored_errors = $this->error_handler->get_stored_errors();

$this->assertEquals( 1, count( $stored_errors ) );
$this->assertSame( 1, count( $stored_errors ) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random thought: Maybe we should have a sniff to prefer assertCount over things like this.

@@ -204,7 +204,7 @@ public static function update_settings( $new_settings ) {
}

// If we set the disabled option to true, clear the queues.
if ( ( 'disable' === $setting || 'network_disable' === $setting ) && ! ! $value ) {
if ( ( 'disable' === $setting || 'network_disable' === $setting ) && (bool) $value ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could drop the (bool) entirely, PHP implicitly casts to bool in this situation anyway.

@anomiex anomiex removed the [Status] Needs Review To request a review from Crew. Label will be renamed soon. label Oct 27, 2020
Base automatically changed from add/phpcs-rules-from-MediaWiki to master October 27, 2020 20:32
@kraftbj kraftbj dismissed anomiex’s stale review October 27, 2020 20:32

The base branch was changed.

@kraftbj kraftbj added [Status] Needs Review To request a review from Crew. Label will be renamed soon. and removed [Status] Blocked / Hold labels Oct 27, 2020
anomiex
anomiex previously approved these changes Oct 28, 2020
Copy link
Contributor

@anomiex anomiex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, Github. It did change the branch to master, but still thinks it wants to apply all the patches from #17406 as part of this patch. Currently when this gets squash-and-merged those will wind up going away, but I have to wonder what would happen if some other patch touching those files got merged in the mean time.

@anomiex anomiex added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Oct 28, 2020
@jetpackbot
Copy link

Scheduled Jetpack release: November 10, 2020.
Scheduled code freeze: November 3, 2020

E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-17617

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Generated by 🚫 dangerJS against 939cae1

@kraftbj kraftbj merged commit 5879967 into master Oct 28, 2020
@kraftbj kraftbj deleted the phpcs/pr-1 branch October 28, 2020 18:59
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Oct 28, 2020
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

5 participants