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": {