Skip to content

Commit 2cc487e

Browse files
authored
ruff server: Introduce settings for directly configuring the linter and formatter (#10984)
## Summary The following client settings have been introduced to the language server: * `lint.preview` * `format.preview` * `lint.select` * `lint.extendSelect` * `lint.ignore` * `exclude` * `lineLength` `exclude` and `lineLength` apply to both the linter and formatter. This does not actually use the settings yet, but makes them available for future use. ## Test Plan Snapshot tests have been updated.
1 parent 5da7299 commit 2cc487e

File tree

3 files changed

+222
-29
lines changed

3 files changed

+222
-29
lines changed

crates/ruff_server/resources/test/fixtures/settings/global_only.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
}
77
},
88
"lint": {
9+
"ignore": ["RUF001"],
910
"run": "onSave"
1011
},
1112
"fixAll": false,
12-
"logLevel": "warn"
13+
"logLevel": "warn",
14+
"lineLength": 80,
15+
"exclude": ["third_party"]
1316
}
1417
}

crates/ruff_server/resources/test/fixtures/settings/vs_code_initialization_options.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
},
5454
"lint": {
5555
"enable": true,
56+
"preview": false,
5657
"run": "onType",
5758
"args": [
5859
"--preview"
@@ -85,6 +86,8 @@
8586
},
8687
"lint": {
8788
"enable": true,
89+
"preview": true,
90+
"select": ["F", "I"],
8891
"run": "onType",
8992
"args": [
9093
"--preview"

0 commit comments

Comments
 (0)