Skip to content

Commit cab1a29

Browse files
authored
Merge pull request #472 from numtide/feat/update-docs
docs: update content to reflect latest changes
2 parents c01bdb3 + 03cb089 commit cab1a29

File tree

7 files changed

+558
-171
lines changed

7 files changed

+558
-171
lines changed

.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dotenv_if_exists .env.local
44
watch_file nix/devshell.nix
55

66
use flake
7+
use flake .#docs

cmd/init/init.toml

+32-16
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,61 @@
11
# One CLI to format the code tree - https://github.com/numtide/treefmt
22

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
45
# allow-missing-formatter = true
56

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
79
# cpu-profile = ./cpu.pprof
810

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
1013
# excludes = ["*.md", "*.gif"]
1114

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
1318
# fail-on-change = true
1419

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
1623
# formatters = ["gofmt", "prettier"]
1724

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
2028
# on-unmatched = "info"
2129

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
2433
# tree-root = "/tmp/foo"
2534

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
2737
# tree-root-file = ".git/config"
2838

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
3142
# verbose = 2
3243

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
3547
# walk = "filesystem"
3648

3749
[formatter.mylanguage]
38-
# Formatter to run
50+
# Command to execute
3951
command = "command-to-run"
4052
# Command-line arguments for the command
4153
options = []
4254
# Glob pattern of files to include
4355
includes = [ "*.<language-extension>" ]
4456
# 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

config/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
// Config is used to represent the list of configured Formatters.
1515
type Config struct {
1616
AllowMissingFormatter bool `mapstructure:"allow-missing-formatter" toml:"allow-missing-formatter,omitempty"`
17-
CI bool `mapstructure:"ci" toml:"ci,omitempty"`
17+
CI bool `mapstructure:"ci" toml:"-"` // not allowed in config
1818
ClearCache bool `mapstructure:"clear-cache" toml:"-"` // not allowed in config
1919
CPUProfile string `mapstructure:"cpu-profile" toml:"cpu-profile,omitempty"`
2020
Excludes []string `mapstructure:"excludes" toml:"excludes,omitempty"`

0 commit comments

Comments
 (0)