Command line tool for QML/JS Run checks
-
Hi,
Is there any way i can run QML/JS Run checks from command line. Currently Qt Creator have option in Tools. If we can run from command line, this is will help us to integrate QML/JS check in the CI system.
-
Hi @p3c0, thanks for the qmllint reference. It looks like it does check syntax errors, and it is helpful.
However Qt Creator supported, QML/JS Run check does check for errors similar to JSlint also. Looks like it is more elaborate. If we can run this from command line it will be great, to integrate into CI system -
Hi @p3c0, thanks for the qmllint reference. It looks like it does check syntax errors, and it is helpful.
However Qt Creator supported, QML/JS Run check does check for errors similar to JSlint also. Looks like it is more elaborate. If we can run this from command line it will be great, to integrate into CI system -
Thanks @p3c0, By looking into the QtCreator source,
Code for the QML/JS run checks is in ,
qmljscheck.cpp
I can see how to invoke the corresponding function in
tst_check.cppViewerContext vContext; vContext.flags = ViewerContext::Complete; ContextPtr context = Link(snapshot, vContext, LibraryInfo())(); Check checker(doc, context); QList<Message> messages = checker(); std::sort(messages.begin(), messages.end(), &offsetComparator);
Hopefully by following qmllint and the above files i should be able to create a command line executable, that gives all the results that QML/JS Run checks gives.
Do you see any problems with this approach. -
Thanks @p3c0, By looking into the QtCreator source,
Code for the QML/JS run checks is in ,
qmljscheck.cpp
I can see how to invoke the corresponding function in
tst_check.cppViewerContext vContext; vContext.flags = ViewerContext::Complete; ContextPtr context = Link(snapshot, vContext, LibraryInfo())(); Check checker(doc, context); QList<Message> messages = checker(); std::sort(messages.begin(), messages.end(), &offsetComparator);
Hopefully by following qmllint and the above files i should be able to create a command line executable, that gives all the results that QML/JS Run checks gives.
Do you see any problems with this approach. -
Thanks @p3c0, it has Commercial and LGPL license. I hope if the work is open sourced back, there shouldn't be any problem.