-
Notifications
You must be signed in to change notification settings - Fork 37
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
[Implement sniff] No PHP short tags #2
Comments
Green light to go ahead : |
I just ran the sniff |
Interesting. As far as I know, by default, PHPCS runs on PHP, JS and CSS files. Nothing else. (according to the docs) [Edit] Actually had a look at more detailed docs and it's more like, it presumes every file is PHP unless you tell it otherwise. I can add a list of file patterns to exclude from the sniffs, but would need input what extensions should be excluded. |
Rule:
No short open tags allowed.
Ref: https://make.wordpress.org/themes/handbook/review/required/theme-check-plugin/#additional-checks
Theme check file covering this rule:
https://github.com/Otto42/theme-check/blob/master/checks/phpshort.php
Decision needed by Theme Review Board:
In the Theme Check plugin, this rule currently generates a warning and the rule is not mentioned on the Theme Review Requirements page.
The existing PHPCS sniff implementation for this -
Generic.PHP.DisallowShortOpenTag
- generates an error. If this should be a warning, either a PR needs to be submitted upstream to PHPCS to allow for changing the error level or alternatively the existing sniff would need to be extended/copied to a WP specific sniff which would do the same, but generate a warning instead of an error.Advice: As short open tags have been removed in PHP 7, I would suggest making this rule a requirement and raising the error level to error instead of warning.
To do:
Generic.PHP.DisallowShortOpenTag
sniff to the ruleset.The text was updated successfully, but these errors were encountered: