Skip to content

Commit 2105d68

Browse files
authored
feat: add dockfmt formatter (#388)
1 parent 421b563 commit 2105d68

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-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)
@@ -245,6 +245,7 @@ functions.
245245
* [deno](programs/deno.nix)
246246
* [dhall](programs/dhall.nix)
247247
* [dnscontrol](programs/dnscontrol.nix)
248+
* [dockfmt](programs/dockfmt.nix)
248249
* [dos2unix](programs/dos2unix.nix)
249250
* [dprint](programs/dprint.nix)
250251
* [efmt](programs/efmt.nix)

examples/formatter-dockfmt.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Example generated by ../examples.sh
2+
[formatter.dockfmt]
3+
command = "dockfmt"
4+
excludes = []
5+
includes = ["Dockerfile", "*.Dockerfile", "Dockerfile.*"]
6+
options = ["fmt", "-w"]

programs/dockfmt.nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{ mkFormatterModule, ... }:
2+
{
3+
meta.maintainers = [ "theobori" ];
4+
5+
imports = [
6+
(mkFormatterModule {
7+
name = "dockfmt";
8+
args = [
9+
"fmt"
10+
"-w"
11+
];
12+
includes = [
13+
"Dockerfile"
14+
"*.Dockerfile"
15+
"Dockerfile.*"
16+
];
17+
})
18+
];
19+
}

0 commit comments

Comments
 (0)