Make WordPress Core

Opened 2 years ago

Closed 21 months ago

Last modified 21 months ago

#54673 closed enhancement (fixed)

Improve formatting in `/wp-admin/user-edit.php`.

Reported by: costdev's profile costdev Owned by: audrasjb's profile audrasjb
Milestone: 6.0 Priority: normal
Severity: normal Version: 5.9
Component: Administration Keywords: has-patch early commit
Focuses: coding-standards Cc:

Description

Follow-up to #53658. See this comment on PR 2069.

The formatting in this file can cause PHPCS failures when adding new code. This requires new code to be indented multiple times, breaking alignment of the HTML. This makes for difficult reading.

In PR 2069, we used // phpcs: disable ... // phpcs: enable for the failing sniffs to preserve alignment of the HTML. This is messy, and would need to be implemented for similar future changes.

Let's fixup this file so that we can remove the annotations and save further workarounds in future.

Attachments (5)

54673.diff (55.5 KB) - added by johnregan3 2 years ago.
Initial patch
54673-1.diff (55.7 KB) - added by johnregan3 21 months ago.
Updated to fix merge conflicts
54673-2.diff (55.4 KB) - added by johnregan3 21 months ago.
Removed errant personal .gitignore changes.
trunk-edit-user.png (278.0 KB) - added by peterwilsoncc 21 months ago.
Edit user screen (trunk)
pr-edit-user.png (278.0 KB) - added by peterwilsoncc 21 months ago.
Edit user screen (pull request)

Download all attachments as: .zip

Change History (14)

This ticket was mentioned in PR #2096 on WordPress/wordpress-develop by johnregan3.


2 years ago
#1

  • Keywords has-patch added; needs-patch removed

Improves formatting in /wp-admin/user-edit.php. Fixes formatting errors caught by PHPCS.

Trac ticket: https://core.trac.wordpress.org/ticket/54673

I've run PHP Unit tests and everything passed (except for the expected skips and risky tests).

Should I update the strict comparison (== vs ===) errors, or are we concerned that some developers might be dependent on the not-strict comparison operators?

@johnregan3
2 years ago

Initial patch

#2 @audrasjb
23 months ago

  • Owner set to audrasjb
  • Status changed from new to reviewing

#3 @audrasjb
23 months ago

  • Keywords early added

Marking this as early for 6.0.

@johnregan3
21 months ago

Updated to fix merge conflicts

johnregan3 commented on PR #2096:


21 months ago
#4

Updated to fix merge conflicts.

@johnregan3
21 months ago

Removed errant personal .gitignore changes.

@peterwilsoncc
21 months ago

Edit user screen (trunk)

@peterwilsoncc
21 months ago

Edit user screen (pull request)

#5 @peterwilsoncc
21 months ago

  • Keywords commit added

Reviewed linked pull request with white space suppressed.

The changes look good to me. Screenshots comparing the screens between the proposed changes and trunk show no apparent difference.

#6 @audrasjb
21 months ago

Alright, let's commit this PR.

#7 @audrasjb
21 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 52820:

Coding Standards: Improve formatting in /wp-admin/user-edit.php.

This change improves the formatting of /wp-admin/user-edit.php to avoid PHPCS failures when adding new code, which previously required new code to be indented multiple times, breaking alignment of the HTML parts. This change avoids disabling/enabling PHPCS for failing sniffs.

Props costdev, johnregan3, peterwilsoncc.
Fixes #54673.

#9 @audrasjb
21 months ago

In 52826:

Docs: Correct the indentation in delete_term_relationships filter.

See #54673.

Note: See TracTickets for help on using tickets.