tweak: make it so disabling uv or ruff fmters disables both (#21921)

This commit is contained in:
Aiden Cline
2026-04-10 13:30:30 -05:00
committed by GitHub
parent d2d5d84d1e
commit ce26120205
2 changed files with 47 additions and 0 deletions

View File

@@ -51,6 +51,13 @@ export namespace Format {
formatters[item.name] = item
}
for (const [name, item] of Object.entries(cfg.formatter ?? {})) {
// Ruff and uv are both the same formatter, so disabling either should disable both.
if (["ruff", "uv"].includes(name) && (cfg.formatter?.ruff?.disabled || cfg.formatter?.uv?.disabled)) {
// TODO combine formatters so shared backends like Ruff/uv don't need linked disable handling here.
delete formatters.ruff
delete formatters.uv
continue
}
if (item.disabled) {
delete formatters[name]
continue