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

qmllint doesn't use local settings

    XMLWordPrintable

Details

    Description

      In my project I have a .qmllint.ini file at the root containing the following:

      [General]
      AdditionalQmlImportPaths=/Users/user/Qt/qml
      DisableDefaultImports=false
      OverwriteImportTypes=
      ResourcePath=
      
      [Warnings]
      BadSignalHandler=warning
      Deprecated=warning
      ImportFailure=warning
      InheritanceCycle=warning
      MultilineStrings=info
      PropertyAlias=warning
      RequiredProperty=warning
      TypeError=warning
      UnknownProperty=warning
      UnqualifiedAccess=warning
      UnusedImports=warning
      WithStatement=warning
      

      qmllint doesn't seem to be using this files settings at all. Browsing through qmllint's source code I believe the issue is here:

      qmllint source code snippet

      #if QT_CONFIG(commandlineparser)
          for (const QString &filename : positionalArguments) {
              if (!parser.isSet(ignoreSettings)) {
                  settings.search(filename); // <<< Settings are updated >>>
                  updateLogLevels();
              }
      #else
          const auto arguments = app.arguments();
          for (const QString &filename : arguments) {
      #endif
      
              // <<< Updated settings not added to qmlImportPaths passed to lint_file. >>>
              success &= lint_file(filename, silent, useJson ? &jsonFiles : nullptr, qmlImportPaths, qmltypesFiles, resourceFiles, options, importer);
          }
      
      

      The only time the settings are used for the qmlImportPaths is in line 374, but at that time the local settings file seem to not have been loaded.

      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
            marcel.gotsch Marcel Gotsch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes