Skip to content

Commit 5101d54

Browse files
authored
Add treefmt (SchemaStore#4988)
1 parent 96df58a commit 5101d54

File tree

4 files changed

+121
-0
lines changed

4 files changed

+121
-0
lines changed

src/api/json/catalog.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,6 +2906,12 @@
29062906
"fileMatch": ["grammar.json"],
29072907
"url": "https://raw.githubusercontent.com/tree-sitter/tree-sitter/master/docs/assets/schemas/config.schema.json"
29082908
},
2909+
{
2910+
"name": "Treefmt",
2911+
"description": "Treefmt configuration file",
2912+
"fileMatch": ["treefmt.toml"],
2913+
"url": "https://www.schemastore.org/treefmt.json"
2914+
},
29092915
{
29102916
"name": "GraphQL Mesh",
29112917
"description": "GraphQL Mesh config file",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"formatter": {
3+
"私のプログラミング言語": {
4+
"command": "command-to-run",
5+
"excludes": [],
6+
"includes": ["*.<language-extension>"],
7+
"options": [],
8+
"priority": 0
9+
}
10+
}
11+
}

src/schemas/json/treefmt.json

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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+
}

src/test/treefmt/treefmt.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"formatter": {
3+
"mylanguage": {
4+
"command": "command-to-run",
5+
"excludes": [],
6+
"includes": ["*.<language-extension>"],
7+
"options": [],
8+
"priority": 0
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)