Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-23652

Clang format WebKit style does not match what the clang-format command line tool produces

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 4.11.1
    • C/C++/Obj-C++ Support
    • None
    • All

      The code generated by using the clang format plugin within QT Creator does not always match the code generated by the official clang-format command line tool. This is causing a lot of headache for our automated code validation steps on build servers

      An example (QSets and literal instantiation):

      Qt Creator want a space between the name of the variable and the beginning '{' like so:

       

      QSet<int> myIntSet {
          1,
          2,
          3
      };
      

      The clang-format tool using the WebKit style, on the other hand, does not want this space:

      QSet<int> myIntSet{
          1,
          2,
          3
      };
      

      I prefer the look of the Qt Creator "style" to be honest, but I guess it should be the same as the official clang-format tool, so that automatic tools that do code linting checks won't fail on code generated within Qt Creator?

       

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

            kosjar Nikolai Kosjar
            madsdk_cercare Mads Kristensen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes