Skip to content

Commit 5539b12

Browse files
committed
dyff: add support for yaml and json sorting formatter
Signed-off-by: William Phetsinorath <william.phetsinorath@shikanime.studio> Change-Id: Iae578ae3513a9241ec5ec39c3235e5ef6a6a6964
1 parent 790751f commit 5539b12

5 files changed

Lines changed: 51 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ functions.
256256
* [dos2unix](programs/dos2unix.nix)
257257
* [dprint](programs/dprint.nix)
258258
* [dscanner](programs/dscanner.nix)
259+
* [dyff-json](programs/dyff-json.nix)
260+
* [dyff-yaml](programs/dyff-yaml.nix)
259261
* [efmt](programs/efmt.nix)
260262
* [elm-format](programs/elm-format.nix)
261263
* [erlfmt](programs/erlfmt.nix)

examples/formatter-dyff-json.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.dyff-json]
3+
command = "dyff"
4+
excludes = []
5+
includes = ["*.json"]
6+
options = ["json"]

examples/formatter-dyff-yaml.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.dyff-yaml]
3+
command = "dyff"
4+
excludes = []
5+
includes = ["*.yaml", "*.yml"]
6+
options = ["yaml", "--restructure", "--in-place"]

programs/dyff-json.nix

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{ mkFormatterModule, ... }:
2+
{
3+
meta.maintainers = [ ];
4+
5+
imports = [
6+
(mkFormatterModule {
7+
name = "dyff-json";
8+
package = "dyff";
9+
args = [
10+
"json"
11+
"--restructure"
12+
"--in-place"
13+
];
14+
includes = [ "*.json" ];
15+
})
16+
];
17+
}

programs/dyff-yaml.nix

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

0 commit comments

Comments
 (0)