GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28k stars 9.32k forks source link

Do something if an invalid category is provided #16085

Open G-Rath opened 1 week ago

G-Rath commented 1 week ago

Feature request summary

It seems like currently the CLI does not validate the actual categories provided for --only-categories - this tripped us up as we were using the PWA category which has since been removed, and so our RSpec matcher started to bomb out.

This has lead to a round of improvements for our matcher which including explicitly checking that the category is present in the output before trying to extract the score, but it occurred to me that it could be useful for everyone if the CLI itself was to better hint at this - even if it was just to add an entry to runWarnings, that could be helpful.

What is the motivation or use case for changing this?

Reduce confusion, making lives easier, etc

How is this beneficial to Lighthouse?

Make it easier for folks to update to newer versions since they can be confident they'll know if a category they're depending on suddenly goes away