Add rules for Python formatting with ruff

This commit is contained in:
Xury Greer
2026-08-08 16:11:14 -07:00
parent 5962cad103
commit 63b9198440
4 changed files with 19 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
{ {
"recommendations": [ "recommendations": [
"charliermarsh.ruff",
"tombi-toml.tombi", "tombi-toml.tombi",
], ],
} }

10
.vscode/settings.json vendored
View File

@@ -1,5 +1,15 @@
{ {
"editor.formatOnSave": true, "editor.formatOnSave": true,
// Use the ruff binary installed in the .venv directory.
"ruff.importStrategy": "fromEnvironment",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.ruff": "explicit",
"source.organizeImports.ruff": "explicit",
},
},
"[toml]": { "[toml]": {
"editor.defaultFormatter": "tombi-toml.tombi", "editor.defaultFormatter": "tombi-toml.tombi",
"editor.formatOnSave": true, "editor.formatOnSave": true,

4
ruff.toml Normal file
View File

@@ -0,0 +1,4 @@
line-length = 120
[lint]
unfixable = ["F401"]

View File

@@ -13,3 +13,7 @@ table-keys-order.enabled = false
[[schemas]] [[schemas]]
path = "https://json.schemastore.org/tombi.json" path = "https://json.schemastore.org/tombi.json"
include = ["tombi.toml"] include = ["tombi.toml"]
[[schemas]]
path = "https://json.schemastore.org/ruff.json"
include = ["ruff.toml"]