katiefenn / parker

Stylesheet analysis tool.
Other
2.47k stars 73 forks source link

Include ability to make assertions #39

Open rupl opened 9 years ago

rupl commented 9 years ago

When using other analysis tools I often take advantage of assertions. For example using phantomas one can assert that the analysis "failed" when there are more than X number of HTTP requests total, or the CSS exceeds a certain number of bytes, etc.

Using assertions within Parker could be a nice way to control the growth of a CSS codebase. I'm looking at stats like "Total Important Keywords" or "Total ID selectors" — things like that.

Possible cons: it might get misused and people might be lured into a false sense of security (or even write code in weird ways to avoid making a certain stat rise).

Would this feature be worthwhile to anyone else? Are there other cons I'm overlooking?

bartveneman commented 7 years ago

Wouldn't it be better to use tools like StyleLint for that? Personally I use Parker for dashboards to we can monitor growth, complexity and branding related issues. From that we decide what adjustments we want to make to make the results more to our liking, but they are hardly ever urgent. For us it means that an occasional !important is allowed, but only if it has already passed code review. Linters are the tools we use to prevent an overflow of unwanted ID's, importants entering the codebase so that we don't have to take too much action after it's in our codebase.

Conclusion (very opinionated): use both tools to their best quality.