mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 13:51:37 +00:00
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:
parent
d54cabd276
commit
097b654ba7
2 changed files with 4 additions and 1 deletions
|
@ -15,7 +15,9 @@ use ruff_text_size::TextSize;
|
||||||
/// The allowed range of values is 1..=320
|
/// The allowed range of values is 1..=320
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
|
||||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
#[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 {
|
impl LineLength {
|
||||||
/// Maximum allowed value for a valid [`LineLength`]
|
/// Maximum allowed value for a valid [`LineLength`]
|
||||||
|
|
1
ruff.schema.json
generated
1
ruff.schema.json
generated
|
@ -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",
|
"description": "The length of a line of text that is considered too long.\n\nThe allowed range of values is 1..=320",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "uint16",
|
"format": "uint16",
|
||||||
|
"maximum": 320.0,
|
||||||
"minimum": 1.0
|
"minimum": 1.0
|
||||||
},
|
},
|
||||||
"LintOptions": {
|
"LintOptions": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue