Command line tool for QML/JS Run checks
-
wrote on 18 Nov 2015, 06:39 last edited by
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,
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.
-
wrote on 18 Nov 2015, 10:04 last edited by
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@Prabha On that site they also mention to use other tools like Json_verify and xmllint. You can make use of all these inside a script.
It could be that similar code is integrated in the QtCreator. You can always check its sources :) -
wrote on 18 Nov 2015, 13:49 last edited by
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.@Prabha Using that code will require you to include the dependent files. You must check with their licenses.
-
Thanks @p3c0, it has Commercial and LGPL license. I hope if the work is open sourced back, there shouldn't be any problem.
@Prabha Yes I guess. But again I'm not a lawyer so I don't have complete understanding of how these work. You can try asking it in a separate post. Some one with knowledge may answer.
2/8