From 21539f1663cd03b8b3a206b49a2ea89d894b04d7 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 14 Sep 2023 14:09:35 -0400 Subject: [PATCH] Allow `NURSERY` in JSON Schema (#7374) ## Summary At some point, we removed these so that they wouldn't be autocompleted for users, since we wanted to discourage usage of `ALL`. But given that they're valid values, I think that was a bad idea -- it leads to an even more confusing experience whereby JSON Schema validators tell you that you have an error, when you don't. Closes https://github.com/astral-sh/ruff/issues/7261. --- crates/ruff/src/rule_selector.rs | 3 ++- ruff.schema.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ruff/src/rule_selector.rs b/crates/ruff/src/rule_selector.rs index fc3e3611af..667f6b430a 100644 --- a/crates/ruff/src/rule_selector.rs +++ b/crates/ruff/src/rule_selector.rs @@ -254,8 +254,9 @@ mod schema { instance_type: Some(InstanceType::String.into()), enum_values: Some( [ - // Include the non-standard "ALL" selector. + // Include the non-standard "ALL" and "NURSERY" selectors. "ALL".to_string(), + "NURSERY".to_string(), // Include the legacy "C" and "T" selectors. "C".to_string(), "T".to_string(), diff --git a/ruff.schema.json b/ruff.schema.json index 4402f3c797..9223d40546 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -2161,6 +2161,7 @@ "NPY001", "NPY002", "NPY003", + "NURSERY", "PD", "PD0", "PD00",