문제

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.

도움이 되었습니까?

해결책 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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top