From f8aa99206d6e8755b02a6f5d292cb4ab8154849b Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 9 Oct 2023 22:29:36 -0400 Subject: [PATCH] fix(schema): restore limit on line-length Signed-off-by: Henry Schreiner --- crates/ruff_linter/src/line_width.rs | 5 ++++- ruff.schema.json | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/line_width.rs b/crates/ruff_linter/src/line_width.rs index 685e473ecc8435..83e22f790da916 100644 --- a/crates/ruff_linter/src/line_width.rs +++ b/crates/ruff_linter/src/line_width.rs @@ -15,7 +15,10 @@ use ruff_text_size::TextSize; /// The allowed range of values is 1..=320 #[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub struct LineLength(NonZeroU16); +pub struct LineLength( +#[cfg_attr(feature = "schemars", schemars(range(min = 1, max = 320)))] + NonZeroU16 +); impl LineLength { /// Maximum allowed value for a valid [`LineLength`] diff --git a/ruff.schema.json b/ruff.schema.json index 49be9e2ae2a449..b5a43347b21e09 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -1556,6 +1556,7 @@ "description": "The length of a line of text that is considered too long.\n\nThe allowed range of values is 1..=320", "type": "integer", "format": "uint16", + "maximum": 320.0, "minimum": 1.0 }, "LintOptions": {