Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-124389

Additional import paths in .qmllint.ini should be relative to .qmllint.ini

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.8
    • 6.5.3, 6.7.0
    • QML: Tooling
    • None
    • Windows 10 with qmllint from Qt 6.5.3 or 6.7.0 (installed from the Maintenance tool)
    • All

    Description

      The repository structure I work on has a structure similar to the following:

      qmllint-ini-paths
       |- .qmllint.ini
       |- src
       | |- Main.qml
       |- submodules
       | |- a
       | | |- qmldir
       | | |- X.qml

      There is a main code directory, and then some submodules under a different path which also contains QML files.

      If I run qmllint using 

      qmllint -I submodules/ src/Main.qml

      then everything works fine. However, if I put

      AdditionalQmlImportPaths=submodules

      in the .qmllint.ini file, and run

      qmllint src/Main.qml

      then I get errors about imports not found (the imports are like import a). Looking at the qmllint code, I think it takes paths from .qmllint.ini files as relative to the QML file it is currently checking (https://code.qt.io/cgit/qt/qtdeclarative.git/tree/tools/qmllint/main.cpp?h=dev#n396), which makes relative paths impossible to use correctly if the QML files being checked are at different subdirectory levels.

      I think it would make more sense to make them relative to the .qmllint.ini file that specified each additional path, but making it relative to the CWD of the qmllint call would also work in my case.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtqmlteam Qt Qml Team User
            matsjoyce-refeyn Matthew Joyce
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes