From ec1be60dcbe297e0c9741e31295b5e9b59019b24 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Thu, 19 Oct 2023 23:20:45 +0530 Subject: [PATCH] Remove leftover constant tuple reference (#8062) This PR removes the leftover reference to the tuple variant in `Constant`. --- crates/ruff_linter/src/rules/pylint/settings.rs | 1 - crates/ruff_python_ast/src/comparable.rs | 1 - crates/ruff_workspace/src/options.rs | 2 +- ruff.schema.json | 3 +-- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/ruff_linter/src/rules/pylint/settings.rs b/crates/ruff_linter/src/rules/pylint/settings.rs index 3ad2892c0e..93e28b2679 100644 --- a/crates/ruff_linter/src/rules/pylint/settings.rs +++ b/crates/ruff_linter/src/rules/pylint/settings.rs @@ -15,7 +15,6 @@ pub enum ConstantType { Float, Int, Str, - Tuple, } impl TryFrom<&Constant> for ConstantType { diff --git a/crates/ruff_python_ast/src/comparable.rs b/crates/ruff_python_ast/src/comparable.rs index b3599402f2..bcf097924f 100644 --- a/crates/ruff_python_ast/src/comparable.rs +++ b/crates/ruff_python_ast/src/comparable.rs @@ -333,7 +333,6 @@ pub enum ComparableConstant<'a> { Str { value: &'a str, unicode: bool }, Bytes(&'a [u8]), Int(&'a ast::Int), - Tuple(Vec>), Float(u64), Complex { real: u64, imag: u64 }, Ellipsis, diff --git a/crates/ruff_workspace/src/options.rs b/crates/ruff_workspace/src/options.rs index 19e53af7ac..081207ac38 100644 --- a/crates/ruff_workspace/src/options.rs +++ b/crates/ruff_workspace/src/options.rs @@ -2392,7 +2392,7 @@ pub struct PylintOptions { /// Constant types to ignore when used as "magic values" (see: `PLR2004`). #[option( default = r#"["str", "bytes"]"#, - value_type = r#"list["str" | "bytes" | "complex" | "float" | "int" | "tuple"]"#, + value_type = r#"list["str" | "bytes" | "complex" | "float" | "int"]"#, example = r#" allow-magic-value-types = ["int"] "# diff --git a/ruff.schema.json b/ruff.schema.json index e7e12d3756..c3e22b74c1 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -708,8 +708,7 @@ "complex", "float", "int", - "str", - "tuple" + "str" ] }, "Convention": {