-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtreefmt.nix
More file actions
57 lines (49 loc) · 1.24 KB
/
treefmt.nix
File metadata and controls
57 lines (49 loc) · 1.24 KB
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
# treefmt configuration for nix-installer
{ pkgs, ... }:
{
# Used to find the project root
projectRootFile = "flake.nix";
# Rust formatting
programs.rustfmt = {
enable = true;
edition = "2024";
};
# Nix formatting (nixfmt-rfc-style is the new standard)
programs.nixfmt = {
enable = true;
package = pkgs.nixfmt-rfc-style;
};
# Shell script formatting and linting
programs.shfmt.enable = true;
programs.shellcheck.enable = true;
settings.formatter.shellcheck.excludes = [
".envrc" # direnv file, not a regular shell script
];
settings.formatter.shfmt.excludes = [
".envrc"
];
# Spell checking (config in _typos.toml)
programs.typos.enable = true;
# TOML formatting
programs.taplo.enable = true;
# YAML formatting
programs.yamlfmt = {
enable = true;
settings.formatter = {
retain_line_breaks = true;
};
};
# Action linting for GitHub workflows
programs.actionlint.enable = true;
# Editorconfig checking
settings.formatter.editorconfig-checker = {
command = pkgs.lib.getExe pkgs.editorconfig-checker;
includes = [ "*" ];
excludes = [
"*.lock"
"target/*"
"*.pp" # selinux binary policy
];
priority = 1; # Run after formatters
};
}