Since Qt 5.15, a new tool qmlformat
is shipped which automatically formats any QML file according to the QML Coding Conventions.
Source: Qt 5.15 release notes
Question
I'm looking for a coding style checker for QML code. Something like Checkstyle or Artistic Style. What do people use to define coding style checks for their DSL of choice?
Clarification: I'm looking for something that can be used in build automation not a GUI tool.
Solution 2
Since Qt 5.15, a new tool qmlformat
is shipped which automatically formats any QML file according to the QML Coding Conventions.
Source: Qt 5.15 release notes
OTHER TIPS
As far as I know QtCreator works well enough with QML. You can specify a coding style you'd like the editor to adhere to. Then use Tools > Reformat File to format the style.
There seems to be a new code formatter called qmlfmt
.
See on github: https://github.com/jesperhh/qmlfmt
Sadly, it doesn't seem to offer a lot of options for now.