Skip to content

Commit

Permalink
fix(schema): restore limit on line-length (#7883)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
henryiii authored and konstin committed Oct 11, 2023
1 parent 3d63f70 commit 674d5e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/ruff_linter/src/line_width.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`]
Expand Down
1 change: 1 addition & 0 deletions ruff.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 674d5e3

Please sign in to comment.