Crates.io | qml_formatter |
lib.rs | qml_formatter |
version | 0.2.0 |
source | src |
created_at | 2022-09-06 15:32:12.484839 |
updated_at | 2022-09-29 12:02:43.063729 |
description | QML formatter |
homepage | https://github.com/qarmin/qml_formatter |
repository | https://github.com/qarmin/qml_formatter |
max_upload_size | |
id | 659583 |
size | 48,725 |
This repository is simple project which implements basic qml formatter, which is used internally inside my projects.
It is alternative for default QML formatter which sometimes broke ours code, so we want to create own app to format files only with needed rules.
I don't expect to add any options to configure it in runtime.
For now formatter can:
Formatter checks for qml files recursively inside provided folders:
qml_formatter folder_with_files_to_check folder_with_files_to_check2 -efolder_with_excluded_files -efolder_with_excluded_files2
e.g.
qml_formatter /home/a /home/b -e/home/a/not_to_check -e/home/a/completelly
will list all files inside folder /home/a
and /home/b
that are not inside /home/a/not_to_check
and /home/a/completelly
.
By default, app runs in interactive mode which require to confirm formatting, but there is additional argument NO_QUESTION
which format files without questions e.g.
qml_formatter /home/a NO_QUESTION
Before:
import QtQuick
import "../../commons/elements"
import "../preparationScreen" as ExamCommons
Text {
id : root
property var able: is_able? no_able: very_able
signal pressed()
image : "qrc://image.svg"
layer.effect: ElevationEffect
{
elevation: elevation
}
}
After
import QtQuick
import "../../commons/elements"
import "../preparationScreen" as ExamCommons
Text {
id: root
property var able: is_able ? no_able : very_able
signal pressed()
image: "qrc://image.svg"
layer.effect: ElevationEffect {
elevation: elevation
}
}
for(abcd)
if(abcd)
DBCC()
will be formatted into
for(abcd)
if(abcd)
DBCC()
as workaround use always brackets, which are fully supported
for(abcd) {
if(abcd) {
DBCC()
}
}
it works fine with simple oneliners
for(ABCD)
BCDF()
will become
for(ABCD)
BCDF()