-
Notifications
You must be signed in to change notification settings - Fork 8
/
treefmt.nix
61 lines (60 loc) · 1.26 KB
/
treefmt.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Copyright 2024 Edgeless Systems GmbH
# SPDX-License-Identifier: AGPL-3.0-only
{ lib, pkgs, ... }:
{
projectRootFile = "flake.nix";
programs = {
# keep-sorted start block=true
actionlint.enable = true;
deadnix.enable = true;
formatjson5 = {
enable = true;
indent = 2;
oneElementLines = true;
sortArrays = true;
};
just.enable = true;
keep-sorted.enable = true;
nixfmt.enable = true;
shellcheck.enable = true;
shfmt.enable = true;
statix.enable = true;
terraform.enable = true;
yamlfmt = {
enable = true;
settings.formatter.retain_line_breaks_single = true;
};
# keep-sorted end
};
settings.formatter = {
addlicense = {
command = "${lib.getExe pkgs.addlicense}";
options = [
"-c=Edgeless Systems GmbH"
"-s=only"
"-l=AGPL-3.0-only"
];
includes = [
"*.go"
"*.nix"
"*.sh"
];
};
vale = {
command = "${
pkgs.vale.withStyles (
s: with s; [
microsoft
google
]
)
}/bin/vale";
options = [ "--no-wrap" ];
includes = [ "*.md" ];
excludes = [
"CODE_OF_CONDUCT.md"
"LICENSE"
];
};
};
}