File tree 2 files changed +49
-1
lines changed
2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 1
1
nav:
2
2
- getting-started
3
+ - guides
3
4
- contributing
4
- - reference
5
+ - reference
Original file line number Diff line number Diff line change
1
+ # Handling Unmatched Files
2
+
3
+ By default, treefmt lists all files that aren't matched by any formatter:
4
+
5
+ ``` console
6
+ $ treefmt
7
+ WARN no formatter for path: .gitignore
8
+ WARN no formatter for path: LICENSE
9
+ WARN no formatter for path: README.md
10
+ WARN no formatter for path: go.mod
11
+ WARN no formatter for path: go.sum
12
+ WARN no formatter for path: build/build.go
13
+ # ...
14
+ ```
15
+
16
+ This helps you decide whether to add formatters for specific files or ignore them entirely.
17
+
18
+ ## Customizing Notifications
19
+
20
+ ### Reducing Log Verbosity
21
+ If you find the unmatched file warnings too noisy, you can lower the logging level in your config:
22
+
23
+ ` treefmt.toml ` :
24
+ ``` toml
25
+ on-unmatched = " debug"
26
+ ```
27
+
28
+ To later find out what files are unmatched, you can override this setting via the command line:
29
+ ``` console
30
+ $ treefmt --on-unmatched warn
31
+ ```
32
+
33
+ ### Enforcing Strict Matching
34
+ Another stricter policy approach is to fail the run if any unmatched files are found.
35
+ This can be paired with an ` excludes ` list to ignore specific files:
36
+
37
+ ` treefmt.toml ` :
38
+ ``` toml
39
+ # Fail if any unmatched files are found
40
+ on-unmatched = " fatal"
41
+
42
+ # List files to explicitly ignore
43
+ excludes = [
44
+ " LICENCE" ,
45
+ " go.sum" ,
46
+ ]
47
+ ```
You can’t perform that action at this time.
0 commit comments