Skip to content

Commit ae61789

Browse files
authored
fix: update schema for "configuration" setting (#117)
1 parent 26604f4 commit ae61789

File tree

2 files changed

+55
-11
lines changed

2 files changed

+55
-11
lines changed

LSP-ruff.sublime-settings

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"initializationOptions": {
33
// See https://docs.astral.sh/ruff/editors/settings/
44
"settings": {
5-
// Path to a ruff.toml or pyproject.toml file to use for configuration.
6-
// By default, Ruff will discover configuration for each project from the filesystem, mirroring the behavior of the Ruff CLI.
5+
// Configuration overrides for Ruff. See the documentation (https://docs.astral.sh/ruff/editors/settings/#configuration) for more details.
76
"configuration": null,
87
// The strategy to use when resolving settings across editor and the filesystem. By default, editor configuration is prioritized over ruff.toml and pyproject.toml files.
98
"configurationPreference": "editorFirst",

sublime-package.json

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,33 @@
1212
"additionalProperties": false,
1313
"properties": {
1414
"configuration": {
15-
"type": ["string", "null"],
1615
"default": null,
17-
"markdownDescription": "Path to a `ruff.toml` or `pyproject.toml` file to use for configuration. By default, Ruff will discover configuration for each project from the filesystem, mirroring the behavior of the Ruff CLI."
16+
"markdownDescription": "Configuration overrides for Ruff. See [the documentation](https://docs.astral.sh/ruff/editors/settings/#configuration) for more details.",
17+
"oneOf": [
18+
{
19+
"type": "string",
20+
"markdownDescription": "Path to a `ruff.toml` or `pyproject.toml` file to use for configuration.",
21+
"examples": [
22+
"~/.ruff.toml"
23+
]
24+
},
25+
{
26+
"type": "object",
27+
"markdownDescription": "Inline JSON configuration for Ruff settings (e.g., `{ \"line-length\": 100 }`). *Added in Ruff 0.9.8.*",
28+
"examples": [
29+
{
30+
"lint": {
31+
"unfixable": [
32+
"F401"
33+
]
34+
},
35+
}
36+
]
37+
},
38+
{
39+
"type": "null",
40+
}
41+
],
1842
},
1943
"configurationPreference": {
2044
"type": "string",
@@ -32,15 +56,21 @@
3256
"markdownDescription": "The strategy to use when resolving settings across editor and the filesystem. By default, editor configuration is prioritized over `ruff.toml` and `pyproject.toml` files."
3357
},
3458
"exclude": {
35-
"type": ["array", "null"],
59+
"type": [
60+
"array",
61+
"null"
62+
],
3663
"default": null,
3764
"items": {
3865
"type": "string"
3966
},
4067
"description": "A list of file patterns to exclude from linting and formatting. See the documentation for more details."
4168
},
4269
"format.preview": {
43-
"type": ["null", "boolean"],
70+
"type": [
71+
"null",
72+
"boolean"
73+
],
4474
"default": null,
4575
"description": "Whether to enable Ruff's preview mode when formatting."
4676
},
@@ -50,36 +80,51 @@
5080
"markdownDescription": "Whether to enable linting. Set to false to use Ruff exclusively as a formatter."
5181
},
5282
"lineLength": {
53-
"type": ["null", "integer"],
83+
"type": [
84+
"null",
85+
"integer"
86+
],
5487
"default": null,
5588
"description": "The line length to use for the linter and formatter."
5689
},
5790
"lint.select": {
58-
"type": ["array", "null"],
91+
"type": [
92+
"array",
93+
"null"
94+
],
5995
"default": null,
6096
"items": {
6197
"type": "string"
6298
},
6399
"description": "Rules to enable by default. See the documentation."
64100
},
65101
"lint.extendSelect": {
66-
"type": ["array", "null"],
102+
"type": [
103+
"array",
104+
"null"
105+
],
67106
"default": null,
68107
"items": {
69108
"type": "string"
70109
},
71110
"markdownDescription": "Rules to enable in addition to those in `lint.select`."
72111
},
73112
"lint.ignore": {
74-
"type": ["array", "null"],
113+
"type": [
114+
"array",
115+
"null"
116+
],
75117
"default": null,
76118
"items": {
77119
"type": "string"
78120
},
79121
"description": "Rules to disable by default. See the documentation."
80122
},
81123
"lint.preview": {
82-
"type": ["null", "boolean"],
124+
"type": [
125+
"null",
126+
"boolean"
127+
],
83128
"default": null,
84129
"description": "Whether to enable Ruff's preview mode when linting."
85130
},

0 commit comments

Comments
 (0)