-
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
Analyse style.css before running the sniffs #174
Comments
I think this is the code that I started https://gist.github.com/grappler/db2918097f54775680c0704890d9a394 |
I'll tag this as next release, so that we have 0.2.0 out before WCEU (and not to block Theme Sniffer new release) 🙂 |
Oh and just thinking: regarding the filtering out of minified JS/CSS files, instead of using the Technical info:
Refs: |
This is good to filter out the obvious minified files. But we'll still have issues with minified files that don't end in Definitely something we'd like for the next update 👍 |
Well, the filter could also examine the contents of files, but to be fair, PHPCS itself already does this and is a lot better at detecting and excluding minified files since v3. |
Once the repo has been de-forked - see #169 -, a bootstrap file can be added which can analyse the
style.css
file in the theme root. This info can then be used by sniffs.Another thing which we may or may not be able to do via the bootstrap file (needs investigation) is remove minified JS files from the list of files to analyse.
I know @grappler has done some initial work on something like this - @grappler is there a branch somewhere with what you did ?
Important: while having this information available can make certain sniffs possible/better, this isn't a silver bullet.
Example:
Once this has been implemented, we can add a sniff checking
add_theme_support()
function calls to verify that all supported features are tagged in thestyle.css
file, but we still will not be able to check that all tags used have the correspondingadd_theme_support()
function call as that won't be clear until the last token of the last file has been reached and at that point, we can no longer throw an error for it.The text was updated successfully, but these errors were encountered: