fix(schema): restore limit on line-length (#7883)

## Summary

Restores functionality of #7875 but in the correct place. Closes #7877.

~~I couldn't figure out how to get cargo fmt to work, so hopefully
that's run in CI.~~ Nevermind, figured it out.

## Test Plan

Can see output of json.
This commit is contained in:
Henry Schreiner 2023-10-09 23:04:08 -04:00 committed by GitHub
parent d54cabd276
commit 097b654ba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -15,7 +15,9 @@ 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`]

1
ruff.schema.json generated
View file

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