-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.10.0
-
282446da4 (dev), 617621657 (6.10)
Code
Based on QTBUG-11030:
import QtQuick import QtQml Window { height: 400 width: 600 visible: true Component.onCompleted: { console.log("Assigning constants...") let [a, b] = [1, 2] console.log(a, b) console.log("Swapping variables...");;; [a, b] = [b, a] console.log(a, b) } }
Steps to reproduce
- Save the code above into Main.qml
- In that folder, run qmlformat --write-defaults
- Run qmlformat Main.qml
- Edit .qmlformat.ini to change SortImports from "false" to "true" and repeat #3
- Edit .qmlformat.ini to change SemicolonRule from "always" to "essential" and repeat #3
- Run qmlformat --semicolon-rule=essential Main.qml
Outcomes
- (Step #3) The import order is not sorted, every line in Console.onCompleted has a single semicolon (Expected)
- (Step #4) The import order is now sorted (Expected)
- (Step #5) Same as Step #4 (Not Expected)
- (Step #6) Only the "Swapping variables..." line has a semicolon (Expected)
| For Gerrit Dashboard: QTBUG-141638 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 674571,6 | qmlformat: Fix SemicolonRule option ignored in config file | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 688279,3 | fix semicolon rule being ignored when set through the .ini file | dev | qt/qtdeclarative | Status: ABANDONED | +1 | 0 |
| 688462,3 | qmlformat: Fix SemicolonRule option ignored in config file | 6.10 | qt/qtdeclarative | Status: MERGED | +2 | 0 |