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

Check that all required headers in style.css are there. #50

Closed
5 tasks
khacoder opened this issue Aug 12, 2016 · 3 comments
Closed
5 tasks

Check that all required headers in style.css are there. #50

khacoder opened this issue Aug 12, 2016 · 3 comments

Comments

@khacoder
Copy link
Contributor

[New sniff] Check that all required headers in style.css are there.

Rule type:

Error

Rule:

ERROR | Check specifically against style.css whether the required headers are found. See Theme-Check plugin - /checks/style_needed.php for the list.

Rule as it is found in the handbook.
There are no other specific rules in this sniff. Most are pretty obvious.

Theme check file covering this rule:

https://github.com/Otto42/theme-check/blob/master/checks/style_needed.php
Required styles are also included in this theme check but they will have to be moved to a separate sniff.

[Optional Section] Decision needed:

There is only the one rule covering text domain requirements. The other checks that will be done are pretty obvious. However if we are striving for rule/sniff consistency I would suggest the following additions.
Stylesheets and Scripts (Required)
The main style.css header requires: Theme name, Description, Author, Version, License, License URI, and Text Domain.

Advice/Request for decision: Should the above header requirements be added to the requirements lists?

Notes for implementation:
  • This sniff will rely on the WordPress_AbstractThemeSniff Class to get the $sniff_helper array.
  • Testing will require that a style.css file is in the same folder as the test file.

To do:

  • Decision and implementation to add the rule in the Theme Review handbook to the Requirements page.
  • Create unit tests
  • Create new sniff
  • Adjust existing WPCS / PHPCS sniff and send in PR upstream.
  • Add existing sniffname sniff to the ruleset.
@khacoder khacoder self-assigned this Aug 12, 2016
@khacoder
Copy link
Contributor Author

I have this sniff ready to go, however it uses the $sniff_helper array from the proposed WordPress_AbstractThemeSniff class.

@dingo-d
Copy link
Member

dingo-d commented May 18, 2019

Again, I think this is something that is added in Theme Sniffer. Not sure if a sniff is needed for this 🤷‍♂

@timelsass comments?

@dingo-d
Copy link
Member

dingo-d commented Apr 8, 2020

We agreed to add this to the Theme Sniffer, because PHPCS 4 won't check css, so we'd have to deprecate this one.

@dingo-d dingo-d closed this as completed Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants