Skip to content

Commit a23b851

Browse files
committed
feat: add qmlformat formatter
1 parent ac8e6f3 commit a23b851

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ functions.
221221
<!-- `> bash ./supported-programs.sh` -->
222222

223223
<!-- BEGIN mdsh -->
224-
`treefmt-nix` currently supports 109 formatters:
224+
`treefmt-nix` currently supports 110 formatters:
225225

226226
* [actionlint](programs/actionlint.nix)
227227
* [alejandra](programs/alejandra.nix)
@@ -303,6 +303,7 @@ functions.
303303
* [prettier](programs/prettier.nix)
304304
* [protolint](programs/protolint.nix)
305305
* [purs-tidy](programs/purs-tidy.nix)
306+
* [qmlformat](programs/qmlformat.nix)
306307
* [rstfmt](programs/rstfmt.nix)
307308
* [rubocop](programs/rubocop.nix)
308309
* [ruff-check](programs/ruff-check.nix)

examples/formatter-qmlformat.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[formatter.qmlformat]
2+
command = "qmlformat"
3+
excludes = []
4+
includes = ["*.qml"]
5+
options = []

programs/qmlformat.nix

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
mkFormatterModule,
3+
...
4+
}:
5+
{
6+
meta.maintainers = [
7+
"fvrings"
8+
];
9+
10+
imports = [
11+
(mkFormatterModule {
12+
name = "qmlformat";
13+
mainProgram = "qmlformat";
14+
package = [
15+
"kdePackages"
16+
"qtdeclarative"
17+
];
18+
args = [
19+
"-i"
20+
];
21+
includes = [
22+
"*.qml"
23+
];
24+
})
25+
];
26+
27+
}

0 commit comments

Comments
 (0)