summaryrefslogtreecommitdiff
path: root/misc/odinfmt.schema.json
blob: 6c82dde335cb69c40284e930f44eeef499bd9cef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"type": "object",
	"properties": {
		"character_width": {
			"type": "integer",
			"default": 100,
			"description": "How many characters it takes before it line breaks it."
		},
		"spaces": {
			"type": "integer",
			"default": 4,
			"description": "Spaces per indentation"
		},
		"newline_limit": {
			"type": "integer",
			"default": 2,
			"description": "The limit of newlines between statements and declarations."
		},
		"tabs": {
			"type": "boolean",
			"default": true,
			"description": "Use tabs instead of spaces"
		},
		"tabs_width": {
			"type": "integer",
			"default": 4,
			"description": "How many characters one tab represents"
		},
		"convert_do": {
			"type": "boolean",
			"default": false,
			"description": "Convert all do statements to brace blocks"
		},
		"exp_multiline_composite_literals": {
			"type": "boolean",
			"default": false,
			"description": "Experimental: Composite literals that span multiple lines are not forcibly inlined"
		},
		"brace_style": {
			"type": "string",
			"enum": ["_1TBS", "Allman", "Stroustrup", "K_And_R"],
			"default": "_1TBS"
		},
		"indent_cases": {
			"type": "boolean",
			"default": false
		},
		"newline_style": {
			"type": "string",
			"enum": ["CRLF", "LF"],
			"default": "CRLF"
		},
		"inline_single_stmt_case": {
			"type": "boolean",
			"default": false,
			"description": "When statement in the clause contains one simple statement, it will inline the case and statement in one line"
		},
		"spaces_around_colons": {
			"type": "boolean",
			"default": false,
			"description": "Put a space on both sides of a single colon during variable/field declaration, such as `foo : bar`"
		},
		"sort_imports": {
			"type": "boolean",
			"default": true,
			"description": "Sorts imports alphabetically"
		},
		"space_single_line_blocks": {
			"type": "boolean",
			"default": false,
			"description": "Put spaces around braces of single-line blocks: `{return 0}` => `{ return 0 }`"
		}
	},
	"required": []
}