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

qmlformat: creates lines over 100 characters long

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.10
    • 6.5.2
    • QML: Tooling
    • None
    • All

    Description

      https://wiki.qt.io/Qt_Coding_Style says:

      "Keep lines shorter than 100 characters"

      Problem: qmlformat creates lines over 100 characters long. 

      E.g. when you qmlformat the attached file, these two lines

              readonly property string minutes:
                  "%1".arg(parseInt(progressSlider.value / 60)).padStart(2, '0')

      are concatenated into a single line 105 characters long. 

      Note: https://doc.qt.io/qt-6/qml-codingconventions.html does not mention line length limit at all, but my understanding is that generic Qt coding style rules would apply in that case. It wouldn't hurt to clarify this in the QML Coding Conventions. 

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              jannej Janne Juntunen
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes