/ .treefmt.toml
.treefmt.toml
1 # SPDX-FileCopyrightText: 2025 sntx <sntx@sntx.space> 2 # SPDX-License-Identifier: AGPL-3.0-or-later 3 4 # One CLI to format the code tree - https://github.com/numtide/treefmt 5 6 # Do not exit with error if a configured formatter is missing 7 # Env $TREEFMT_ALLOW_MISSING_FORMATTER 8 # allow-missing-formatter = true 9 10 # The file into which a cpu profile will be written 11 # Env $TREEFMT_CPU_PROFILE 12 # cpu-profile = ./cpu.pprof 13 14 # Exclude files or directories matching the specified globs 15 # Env $TREEFMT_EXCLUDES 16 excludes = [ 17 ".envrc", 18 ".gitignore", 19 "*.age", 20 "*.lock", 21 ".idea/*", 22 ".git/*", 23 ".direnv/*", 24 ".editorconfig", 25 ] 26 27 # Exit with error if any changes were made during execution 28 # Useful for CI 29 # Env $TREEFMT_FAIL_ON_CHANGE 30 # fail-on-change = true 31 32 # A list of formatters to apply 33 # Defaults to all configured formatters 34 # Env $TREEFMT_FORMATTERS 35 # formatters = ["gofmt", "prettier"] 36 37 # Log paths that did not match any formatters at the specified log level 38 # Possible values are <debug|info|warn|error|fatal> 39 # Env $TREEFMT_ON_UNMATCHED 40 # on-unmatched = "info" 41 42 # The root directory from which treefmt will start walking the filesystem 43 # Defaults to the directory containing the config file 44 # Env $TREEFMT_TREE_ROOT 45 # tree-root = "/tmp/foo" 46 47 # File to search for to find the tree root (if tree-root is not set) 48 # Env $TREEFMT_TREE_ROOT_FILE 49 # tree-root-file = ".git/config" 50 51 # Set the verbosity of logs 52 # 0 = warn, 1 = info, 2 = debug 53 # Env $TREEFMT_VERBOSE 54 # verbose = 2 55 56 # The method used to traverse the files within the tree root 57 # Currently, we support 'auto', 'git' or 'filesystem' 58 # Env $TREEFMT_WALK 59 walk = "filesystem" 60 61 # [formatter.mylanguage] 62 # Command to execute 63 # command = "command-to-run" 64 # Command-line arguments for the command 65 # options = [] 66 # Glob pattern of files to include 67 # includes = [ "*.<language-extension>" ] 68 # Glob patterns of files to exclude 69 # excludes = [] 70 # Controls the order of application when multiple formatters match the same file 71 # Lower the number, the higher the precedence 72 # Default is 0 73 # priority = 0 74 75 [formatter.nix] 76 command = "nixfmt" 77 includes = ["*.nix"] 78 79 [formatter.toml] 80 command = "taplo" 81 options = ["fmt"] 82 includes = ["*.toml"] 83 84 [formatter.md] 85 command = "prettier" 86 options = ["--parser=markdown"] 87 includes = ["*.md"] 88 89 [formatter.sh] 90 command = "shfmt" 91 options = ["--write"] 92 includes = ["*.sh"]