Skip to content

Commit

Permalink
Merge pull request #472 from numtide/feat/update-docs
Browse files Browse the repository at this point in the history
docs: update content to reflect latest changes
  • Loading branch information
brianmcgee authored Nov 8, 2024
2 parents c01bdb3 + 03cb089 commit cab1a29
Show file tree
Hide file tree
Showing 7 changed files with 558 additions and 171 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dotenv_if_exists .env.local
watch_file nix/devshell.nix

use flake
use flake .#docs
48 changes: 32 additions & 16 deletions cmd/init/init.toml
Original file line number Diff line number Diff line change
@@ -1,45 +1,61 @@
# One CLI to format the code tree - https://github.com/numtide/treefmt

# Do not exit with error if a configured formatter is missing (env $TREEFMT_ALLOW_MISSING_FORMATTER)
# Do not exit with error if a configured formatter is missing
# Env $TREEFMT_ALLOW_MISSING_FORMATTER
# allow-missing-formatter = true

# The file into which a cpu profile will be written (env $TREEFMT_CPU_PROFILE)
# The file into which a cpu profile will be written
# Env $TREEFMT_CPU_PROFILE
# cpu-profile = ./cpu.pprof

# Exclude files or directories matching the specified globs (env $TREEFMT_EXCLUDES)
# Exclude files or directories matching the specified globs
# Env $TREEFMT_EXCLUDES
# excludes = ["*.md", "*.gif"]

# Exit with error if any changes were made. Useful for CI (env $TREEFMT_FAIL_ON_CHANGE)
# Exit with error if any changes were made during execution
# Useful for CI
# Env $TREEFMT_FAIL_ON_CHANGE
# fail-on-change = true

# Specify formatters to apply. Defaults to all configured formatters. (env $TREEFMT_FORMATTERS)
# A list of formatters to apply
# Defaults to all configured formatters
# Env $TREEFMT_FORMATTERS
# formatters = ["gofmt", "prettier"]

# Log paths that did not match any formatters at the specified log level.
# Possible values are <debug|info|warn|error|fatal>. (env $TREEFMT_ON_UNMATCHED)
# Log paths that did not match any formatters at the specified log level
# Possible values are <debug|info|warn|error|fatal>
# Env $TREEFMT_ON_UNMATCHED
# on-unmatched = "info"

# The root directory from which treefmt will start walking the filesystem (defaults to the directory containing the
# config file). (env $TREEFMT_TREE_ROOT)
# The root directory from which treefmt will start walking the filesystem
# Defaults to the directory containing the config file
# Env $TREEFMT_TREE_ROOT
# tree-root = "/tmp/foo"

# File to search for to find the tree root (if --tree-root is not passed). (env $TREEFMT_TREE_ROOT_FILE)
# File to search for to find the tree root (if tree-root is not set)
# Env $TREEFMT_TREE_ROOT_FILE
# tree-root-file = ".git/config"

# Set the verbosity of logs e.g.
# 0 = warn, 1 = info, 2 = debug (env $TREEFMT_VERBOSE)
# Set the verbosity of logs
# 0 = warn, 1 = info, 2 = debug
# Env $TREEFMT_VERBOSE
# verbose = 2

# The method used to traverse the files within the tree root.
# Currently supports 'auto', 'git' or 'filesystem'. (env $TREEFMT_WALK)
# The method used to traverse the files within the tree root
# Currently, we support 'auto', 'git' or 'filesystem'
# Env $TREEFMT_WALK
# walk = "filesystem"

[formatter.mylanguage]
# Formatter to run
# Command to execute
command = "command-to-run"
# Command-line arguments for the command
options = []
# Glob pattern of files to include
includes = [ "*.<language-extension>" ]
# Glob patterns of files to exclude
excludes = []
excludes = []
# Controls the order of application when multiple formatters match the same file
# Lower the number, the higher the precedence
# Default is 0
priority = 0
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
// Config is used to represent the list of configured Formatters.
type Config struct {
AllowMissingFormatter bool `mapstructure:"allow-missing-formatter" toml:"allow-missing-formatter,omitempty"`
CI bool `mapstructure:"ci" toml:"ci,omitempty"`
CI bool `mapstructure:"ci" toml:"-"` // not allowed in config
ClearCache bool `mapstructure:"clear-cache" toml:"-"` // not allowed in config
CPUProfile string `mapstructure:"cpu-profile" toml:"cpu-profile,omitempty"`
Excludes []string `mapstructure:"excludes" toml:"excludes,omitempty"`
Expand Down
Loading

0 comments on commit cab1a29

Please sign in to comment.