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

qmllint: beautify --help output

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.x
    • 6.2
    • QML: Tooling

    Description

      I have the following output from qmllint:

      ag@ag:~/work/build/qt5$ ./qtbase/bin/qmllint --help
      Usage: ./qtbase/bin/qmllint [options] files
      QML syntax verifier and analyzer
      
      All warnings can be set to three levels:
          disabled - Fully disables the warning.
          info - Displays the warning but does not influence the return code.
          warning - Displays the warning and leads to a non-zero exit code if encountered.
      
      
      Options:
        -h, --help                   Displays help on commandline options.
        --help-all                   Displays help including Qt specific options.
        -v, --version                Displays version information.
        -s, --silent                 Don't output syntax errors
        --json                       Output linting errors as JSON
        --write-defaults             Writes defaults settings to .qmllint.ini and
                                     exits (Warning: This will overwrite any existing
                                     settings and comments!)
        --ignore-settings            Ignores all settings files and only takes
                                     command line options into consideration
        --alias <level>              Warn about alias errors (default: warning)
        --compiler <level>           Warn about compiler issues (default: disable)
        --deprecated <level>         Warn about deprecated properties and types
                                     (default: warning)
        --import <level>             Warn about failing imports and deprecated
                                     qmltypes (default: warning)
        --inheritance-cycle <level>  Warn about inheritance cycles (default: warning)
        --multiline-strings <level>  Warn about multiline strings (default: info)
        --property <level>           Warn about unknown properties (default: warning)
        --required <level>           Warn about required properties (default:
                                     warning)
        --signal <level>             Warn about bad signal handler parameters
                                     (default: warning)
        --type <level>               Warn about unresolvable types and type
                                     mismatches (default: warning)
        --unqualified <level>        Warn about unqualified identifiers and how to
                                     fix them (default: warning)
        --unused-imports <level>     Warn about unused imports (default: info)
        --with <level>               Warn about with statements as they can cause
                                     false positives when checking for unqualified
                                     access (default: warning)
        --resource <resource>        Look for related files in the given resource
                                     file
        -I, --qmldirs <directory>    Look for QML modules in specified directory
        --bare                       Do not include default import directories or the
                                     current directory. This may be used to run
                                     qmllint on a project using a different Qt
                                     version.
        -i, --qmltypes <qmltypes>    Import the specified qmltypes files. By default,
                                     all qmltypes files found in the current directory
                                     are used. When this option is set, you have to
                                     explicitly add files from the current directory
                                     if you want them to be used.
      
      Arguments:
        files                        list of qml or js files to verify
      

      Note that all the warning categories are in the middle (why?) which makes finding them particularly challenging. Is this something we can control and modify? (i'd guess so as it doesn't look like sorted or anything).
      Given that we point the users to look at category names (e.g. to disable certain ones), it would be nice if that information is easily parsed by humans.

      Suggestion: let's just put all the categories at the end of the options list so that we have "constant" options first and then the ever-growing list of warning categories.
      Additionally, maybe we can also put the "All warnings can be set to three levels" message somewhere nearby for convenience as well.

      Attachments

        For Gerrit Dashboard: QTBUG-95971
        # Subject Branch Project Status CR V

        Activity

          People

            qtqmlteam Qt Qml Team User
            agolubev Andrei Golubev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes