qsslint – A linter for Qt stylesheets A new KDAB contribution
Enter the wonderful world of tools for which the announcement blog takes more time to write than the tool itself.
qsslint is a small command-line utility for verifying the syntax of your Qt stylesheet files (*.qss). It’s much like KDAB’s previous linter contribution, qmllint. It simply returns 0 if the stylesheet is valid, and non-zero otherwise.
Don’t get me wrong, I do dislike CSS and don’t want to encourage its use. But if you can’t run away from it, then at least use a linter to catch errors at compile time rather than production.
The suggested way to use these tools in your day-to-day is: you don’t. Instead, incorporate them into your build system or CI and forget about them until a developer makes a typo.
Furthermore, use the same advice for each different source file-type. Be it XML, JSON or QML, there are plenty of linters available. And finally, for C++, the compiler already checks the syntax for you, but now you can also verify Qt semantics by using clazy, or get advanced C++ diagnostics with clang-tidy.
So, what else should we do at build time ? Suggestions welcome. 🙂