|
| 1 | +{ |
| 2 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | + "$id": "https://www.schemastore.org/treefmt.json", |
| 4 | + "title": "JSON schema for treefmt configuration files", |
| 5 | + "description": "https://treefmt.com", |
| 6 | + "type": "object", |
| 7 | + "properties": { |
| 8 | + "allow-missing-formatter": { |
| 9 | + "type": "boolean", |
| 10 | + "default": false, |
| 11 | + "description": "Do not exit with error if a configured formatter is missing" |
| 12 | + }, |
| 13 | + "cpu-profile": { |
| 14 | + "type": "string", |
| 15 | + "description": "The file into which a cpu profile will be written" |
| 16 | + }, |
| 17 | + "excludes": { |
| 18 | + "type": "array", |
| 19 | + "items": { "type": "string" }, |
| 20 | + "description": "Exclude files or directories matching the specified globs" |
| 21 | + }, |
| 22 | + "fail-on-change": { |
| 23 | + "type": "boolean", |
| 24 | + "description": "Exit with error if any changes were made during execution; useful for CI" |
| 25 | + }, |
| 26 | + "formatters": { |
| 27 | + "type": "array", |
| 28 | + "items": { "type": "string" }, |
| 29 | + "description": "A list of formatters to apply. Defaults to all configured formatters" |
| 30 | + }, |
| 31 | + "on-unmatched": { |
| 32 | + "type": "string", |
| 33 | + "enum": ["debug", "info", "warn", "error", "fatal"], |
| 34 | + "description": "Log paths that did not match any formatters at the specified log level" |
| 35 | + }, |
| 36 | + "tree-root": { |
| 37 | + "type": "string", |
| 38 | + "description": "The root directory from which treefmt will start walking the filesystem. Defaults to the root of the current git worktree. If not in a git repo, defaults to the directory containing the config file." |
| 39 | + }, |
| 40 | + "tree-root-file": { |
| 41 | + "type": "string", |
| 42 | + "description": "File to search for to find the tree root (if tree-root is not set)" |
| 43 | + }, |
| 44 | + "tree-root-cmd": { |
| 45 | + "type": "string", |
| 46 | + "description": "Command to run to find the tree root. It is parsed using shlex, to allow quoting arguments that contain whitespace. If you wish to pass arguments containing quotes, you should use nested quotes e.g. \"'\" or '\"'" |
| 47 | + }, |
| 48 | + "verbose": { |
| 49 | + "type": "integer", |
| 50 | + "minimum": 0, |
| 51 | + "maximum": 2, |
| 52 | + "description": "Set the verbosity of logs (0 = warn, 1 = info, 2 = debug)" |
| 53 | + }, |
| 54 | + "walk": { |
| 55 | + "type": "string", |
| 56 | + "enum": ["auto", "git", "filesystem"], |
| 57 | + "description": "The method used to traverse the files within the tree root" |
| 58 | + }, |
| 59 | + "formatter": { |
| 60 | + "type": "object", |
| 61 | + "patternProperties": { |
| 62 | + "^[a-zA-Z0-9_-]+$": { |
| 63 | + "type": "object", |
| 64 | + "properties": { |
| 65 | + "command": { "type": "string" }, |
| 66 | + "options": { |
| 67 | + "type": "array", |
| 68 | + "items": { "type": "string" } |
| 69 | + }, |
| 70 | + "includes": { |
| 71 | + "type": "array", |
| 72 | + "items": { "type": "string" } |
| 73 | + }, |
| 74 | + "excludes": { |
| 75 | + "type": "array", |
| 76 | + "items": { "type": "string" } |
| 77 | + }, |
| 78 | + "priority": { |
| 79 | + "type": "integer", |
| 80 | + "default": 0 |
| 81 | + } |
| 82 | + }, |
| 83 | + "additionalProperties": false |
| 84 | + } |
| 85 | + }, |
| 86 | + "additionalProperties": false |
| 87 | + } |
| 88 | + }, |
| 89 | + "additionalProperties": true, |
| 90 | + "x-taplo-info": { |
| 91 | + "patterns": ["^treefmt\\.toml?$"] |
| 92 | + } |
| 93 | +} |
0 commit comments