Closed alexweissman closed 4 years ago
We should add https://scrutinizer-ci.com/ to lint js, css and php at once 💪
Is this something we can easily integrate into GitHub?
You only have to register and add the repository. It checks the code on every commit / pr etc. just like Travis does with the builds.
Having some service to lint this project as a whole would be a good idea however the benefits would be limited to us.
I've been thinking about this for some time now, and I think the best solution here would be allowing custom scripts in each sprinkle. Work done for 4.2 (common frontend dependencies location, much like how we resolve backend dependencies via composer to a common location) opens up node_modules
as a safe location to have in a sprinkle.
In terms of linting CSS the thought process is that we have a default linter that can be run, but allow individual to override this with their own.
I'd like to see this expanded with a few build hooks to better facilitate more complex build process in time, that however will be much more complex as ~dev~ debug mode will need to be considered. Before something this complex could even be attempted, caching (#938) would need to be implemented first. This is best discussed in another issue, but the goal would be supporting custom frontends that use React, Vue, etc which have seen a surge in popularity. V5 will provide first class support, but we may as well support it in UF4.X is we can.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Does style-ci handle this now?
Not that I've noticed. Could be a config thing (adding support that is automatic opt-in would be annoying for existing users as it would break builds).
It's possible to write malformed CSS that can be properly interpreted by most browsers, but will cause problems when passed through the minification process. As a result, you can end up with styling that worked fine in development, but fails in production.
Adding a CSS linter to the build pipeline would ensure that problems like this are flagged, rather than silently breaking styling when you deploy malformed CSS.