Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Command line tool for QML/JS Run checks

Command line tool for QML/JS Run checks

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 2 Posters 2.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Prabha
    wrote on last edited by
    #1

    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.

    p3c0P 1 Reply Last reply
    0
    • P Prabha

      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.

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi @Prabha, You are probably looking for qmllint.

      157

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Prabha
        wrote on last edited by
        #3

        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

        p3c0P 1 Reply Last reply
        0
        • P Prabha

          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

          p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          @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 :)

          157

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Prabha
            wrote on last edited by
            #5

            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.cpp

            ViewerContext 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.

            p3c0P 1 Reply Last reply
            0
            • P Prabha

              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.cpp

              ViewerContext 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.

              p3c0P Offline
              p3c0P Offline
              p3c0
              Moderators
              wrote on last edited by
              #6

              @Prabha Using that code will require you to include the dependent files. You must check with their licenses.

              157

              1 Reply Last reply
              0
              • P Offline
                P Offline
                Prabha
                wrote on last edited by
                #7

                Thanks @p3c0, it has Commercial and LGPL license. I hope if the work is open sourced back, there shouldn't be any problem.

                p3c0P 1 Reply Last reply
                0
                • P Prabha

                  Thanks @p3c0, it has Commercial and LGPL license. I hope if the work is open sourced back, there shouldn't be any problem.

                  p3c0P Offline
                  p3c0P Offline
                  p3c0
                  Moderators
                  wrote on last edited by
                  #8

                  @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.

                  157

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved