#49376 closed task (blessed) (fixed)
Adjust coding standards to always omit parenthesis for include/require statements
Reported by: | desrosj | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.4 | Priority: | low |
Severity: | trivial | Version: | |
Component: | General | Keywords: | has-patch commit |
Focuses: | coding-standards | Cc: |
Description
This is a follow-up of #48082 and the changes committed in [47198].
Now that all parenthesis have been removed from include
/include_once
/require
/require_once
statements, the PHCS configuration file should also be updated to enforce this until the sniff is moved from the WordPress-Extra
ruleset to the WordPress-Core
ruleset upstream in the WordPress Coding Standards repo (pull request coming soon).
Running this sniff on trunk
today produces 4 errors, all of them are instances where two spaces are included after return
and echo
statements instead of one. These instances are all typos and should be fixed.
The PHP coding standards in the handbook should also be updated to reflect that parenthesis should be omitted, and one space and one space only should follow these language constructs to satisfy this check.
Attachments (2)
Change History (7)
#2
@
8 weeks ago
- Keywords needs-refresh added
The Squiz.WhiteSpace.LanguageConstructSpacing
sniff is deprecated and will be removed in PHPCS 4.0.
Consider using Generic.WhiteSpace.LanguageConstructSpacing
instead. Though, since this change is intended as a temporary one until WPCS itself changes (which should happen before PHPCS 4.0), leave as is.
#3
@
7 weeks ago
- Keywords commit added; needs-refresh removed
LGTM
And yes, leave the LanguageContructSpacing
one as is. Once it's moved in WPCS (and a new WPCS version released), these rules can be removed and that should be soon enough.
WPCS will then take care of the sniff change-over automatically if and when.
#4
@
7 weeks ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 47207:
49376.2.diff adds the rules for parenthesis that I missed in the first patch.