1
1
# One CLI to format the code tree - https://github.com/numtide/treefmt
2
2
3
- # Do not exit with error if a configured formatter is missing (env $TREEFMT_ALLOW_MISSING_FORMATTER)
3
+ # Do not exit with error if a configured formatter is missing
4
+ # Env $TREEFMT_ALLOW_MISSING_FORMATTER
4
5
# allow-missing-formatter = true
5
6
6
- # The file into which a cpu profile will be written (env $TREEFMT_CPU_PROFILE)
7
+ # The file into which a cpu profile will be written
8
+ # Env $TREEFMT_CPU_PROFILE
7
9
# cpu-profile = ./cpu.pprof
8
10
9
- # Exclude files or directories matching the specified globs (env $TREEFMT_EXCLUDES)
11
+ # Exclude files or directories matching the specified globs
12
+ # Env $TREEFMT_EXCLUDES
10
13
# excludes = ["*.md", "*.gif"]
11
14
12
- # Exit with error if any changes were made. Useful for CI (env $TREEFMT_FAIL_ON_CHANGE)
15
+ # Exit with error if any changes were made during execution
16
+ # Useful for CI
17
+ # Env $TREEFMT_FAIL_ON_CHANGE
13
18
# fail-on-change = true
14
19
15
- # Specify formatters to apply. Defaults to all configured formatters. (env $TREEFMT_FORMATTERS)
20
+ # A list of formatters to apply
21
+ # Defaults to all configured formatters
22
+ # Env $TREEFMT_FORMATTERS
16
23
# formatters = ["gofmt", "prettier"]
17
24
18
- # Log paths that did not match any formatters at the specified log level.
19
- # Possible values are <debug|info|warn|error|fatal>. (env $TREEFMT_ON_UNMATCHED)
25
+ # Log paths that did not match any formatters at the specified log level
26
+ # Possible values are <debug|info|warn|error|fatal>
27
+ # Env $TREEFMT_ON_UNMATCHED
20
28
# on-unmatched = "info"
21
29
22
- # The root directory from which treefmt will start walking the filesystem (defaults to the directory containing the
23
- # config file). (env $TREEFMT_TREE_ROOT)
30
+ # The root directory from which treefmt will start walking the filesystem
31
+ # Defaults to the directory containing the config file
32
+ # Env $TREEFMT_TREE_ROOT
24
33
# tree-root = "/tmp/foo"
25
34
26
- # File to search for to find the tree root (if --tree-root is not passed). (env $TREEFMT_TREE_ROOT_FILE)
35
+ # File to search for to find the tree root (if tree-root is not set)
36
+ # Env $TREEFMT_TREE_ROOT_FILE
27
37
# tree-root-file = ".git/config"
28
38
29
- # Set the verbosity of logs e.g.
30
- # 0 = warn, 1 = info, 2 = debug (env $TREEFMT_VERBOSE)
39
+ # Set the verbosity of logs
40
+ # 0 = warn, 1 = info, 2 = debug
41
+ # Env $TREEFMT_VERBOSE
31
42
# verbose = 2
32
43
33
- # The method used to traverse the files within the tree root.
34
- # Currently supports 'auto', 'git' or 'filesystem'. (env $TREEFMT_WALK)
44
+ # The method used to traverse the files within the tree root
45
+ # Currently, we support 'auto', 'git' or 'filesystem'
46
+ # Env $TREEFMT_WALK
35
47
# walk = "filesystem"
36
48
37
49
[formatter .mylanguage ]
38
- # Formatter to run
50
+ # Command to execute
39
51
command = " command-to-run"
40
52
# Command-line arguments for the command
41
53
options = []
42
54
# Glob pattern of files to include
43
55
includes = [ " *.<language-extension>" ]
44
56
# Glob patterns of files to exclude
45
- excludes = []
57
+ excludes = []
58
+ # Controls the order of application when multiple formatters match the same file
59
+ # Lower the number, the higher the precedence
60
+ # Default is 0
61
+ priority = 0
0 commit comments