-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtreefmt.toml
More file actions
103 lines (90 loc) · 2.94 KB
/
Copy pathtreefmt.toml
File metadata and controls
103 lines (90 loc) · 2.94 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# treefmt configuration
# Reference: https://treefmt.com/latest/getting-started/configure/
# Formats multiple file types with a single command
# Usage: treefmt (or nix run .#treefmt via treefmt-nix)
# Note: treefmt-nix handles proper command setup automatically
# This file is for direct treefmt usage (when treefmt is in PATH)
# Global options
# Exit with error if any changes were made (useful for CI)
# fail-on-change = false
# Log level for unmatched files (files not handled by any formatter)
# Options: debug, info, warn, error, fatal
# Set to "fatal" to fail if unmatched files are found (strict mode)
# Set to "debug" to reduce noise (default warnings suppressed)
on-unmatched = "debug"
# Exclude files or directories matching the specified globs
# These files are ignored entirely and won't trigger unmatched warnings
excludes = [
# Build artifacts
"result",
"result-*",
".direnv",
".git",
# Editor temporary files
"*.swp",
"*.swo",
"*~",
# Common unmatched file types
"*.toml", # TOML files (except treefmt.toml itself)
"*.lock", # Lock files (flake.lock, etc.)
# Note: *.sh, *.yaml, *.yml, *.json, *.md, *.py now have formatters
".gitignore", # Git ignore files
".editorconfig", # Editor config
"justfile", # Justfile
"LICENSE", # License files
"LICENCE", # License files (alternative spelling)
# Documentation directories
"docs/**",
"tmp/**",
"references/**",
# Secrets
"secrets/**",
]
# Nix formatters
[formatter.nixfmt]
command = "nixfmt"
includes = ["*.nix"]
[formatter.deadnix]
command = "deadnix"
includes = ["*.nix"]
options = ["--fail"]
# statix disabled - doesn't work well with treefmt file-by-file processing
# statix expects directories, not individual files
# Run manually: statix check . (or statix fix .)
# [formatter.statix]
# command = "statix"
# includes = ["*.nix"]
# options = ["check"]
# Shell script formatters
[formatter.shfmt]
command = "shfmt"
includes = ["*.sh"]
options = ["-w", "-s"]
# shellcheck removed - it's a linter, not a formatter
# Run shellcheck separately: shellcheck scripts/*.sh
# Python formatters
[formatter.ruff-format]
command = "ruff"
includes = ["*.py"]
options = ["format"]
[formatter.ruff-check]
command = "ruff"
includes = ["*.py"]
options = ["check", "--fix"]
# Note: ruff-check is primarily a linter, but --fix makes it a formatter
# YAML formatter
[formatter.yamlfmt]
command = "yamlfmt"
includes = ["*.yaml", "*.yml"]
# Exclude GitHub Actions workflows (handled by actionlint)
excludes = [".github/workflows/*.yml", ".github/workflows/*.yaml"]
# Multi-language formatter (JavaScript/TypeScript/JSON/CSS/HTML/etc)
[formatter.prettier]
command = "prettier"
includes = ["*.js", "*.ts", "*.jsx", "*.tsx", "*.json", "*.css", "*.html", "*.md"]
options = ["--write"]
# GitHub Actions linter
[formatter.actionlint]
command = "actionlint"
includes = [".github/workflows/*.yml", ".github/workflows/*.yaml"]
# Note: actionlint is a linter, not a formatter