-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtreefmt.nix
67 lines (65 loc) · 1.5 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
62
63
64
65
66
67
# treefmt.nix
{ ... }:
{
# Used to find the project root
projectRootFile = "flake.nix";
# enable formatters and linters
programs.actionlint.enable = true;
programs.clang-format.enable = true;
programs.cmake-format.enable = true;
programs.dos2unix.enable = true;
programs.keep-sorted.enable = true;
programs.ruff-check.enable = true;
programs.ruff-format.enable = true;
programs.shellcheck.enable = true;
programs.shfmt.enable = true;
# TODO: Look into enabling mypy
programs.nixfmt.enable = true;
programs.prettier.enable = true;
programs.taplo.enable = true;
programs.typos.enable = true;
programs.yamlfmt.enable = true;
# config
settings = {
global = {
excludes = [
# build dirs
"build/**"
"result/**"
# generated stuff
"generated/**"
"treefmt.toml"
# docs
"docs/figures-source/**"
"docs/pyproject/**"
"docs/source/_static/fonts/**"
"docs/source/robots.txt"
"docs/source/intersphinx/**"
# config
"*.rviz"
"setup.cfg"
# ros stuff
"software/ros_ws/src/**/resource/**"
# non-formattable file types
"*.drawio"
"*.svg"
"*.png"
"*.jpg"
"*.jpeg"
"*.gif"
"*.bmp"
"*.ico"
"*.pdf"
];
};
formatter = {
cmake-format = {
includes = [
"CMakeLists.txt"
"**/CMakeLists.txt"
"**/*.cmake"
];
};
};
};
}