Remove min and max range on line-length JSON schema (#7875)

## Summary

This was introduced in https://github.com/astral-sh/ruff/pull/7412, but
SchemaStore doesn't accept it. I manually edited the JSON schema last
time, then tried to fix this, then gave up -- so removing for now.

(See, e.g., https://github.com/SchemaStore/schemastore/pull/3278, which
failed prior to removing the min and max.)
This commit is contained in:
Charlie Marsh 2023-10-09 15:36:43 -04:00 committed by GitHub
parent 7faa43108f
commit d54cabd276
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View file

@ -2,12 +2,11 @@ use std::collections::BTreeSet;
use std::hash::BuildHasherDefault; use std::hash::BuildHasherDefault;
use regex::Regex; use regex::Regex;
use ruff_formatter::IndentStyle;
use rustc_hash::{FxHashMap, FxHashSet}; use rustc_hash::{FxHashMap, FxHashSet};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use strum::IntoEnumIterator; use strum::IntoEnumIterator;
use crate::options_base::{OptionsMetadata, Visit}; use ruff_formatter::IndentStyle;
use ruff_linter::line_width::{LineLength, TabSize}; use ruff_linter::line_width::{LineLength, TabSize};
use ruff_linter::rules::flake8_pytest_style::settings::SettingsError; use ruff_linter::rules::flake8_pytest_style::settings::SettingsError;
use ruff_linter::rules::flake8_pytest_style::types; use ruff_linter::rules::flake8_pytest_style::types;
@ -30,6 +29,7 @@ use ruff_linter::{warn_user_once, RuleSelector};
use ruff_macros::{CombineOptions, OptionsMetadata}; use ruff_macros::{CombineOptions, OptionsMetadata};
use ruff_python_formatter::QuoteStyle; use ruff_python_formatter::QuoteStyle;
use crate::options_base::{OptionsMetadata, Visit};
use crate::settings::LineEnding; use crate::settings::LineEnding;
#[derive(Debug, PartialEq, Eq, Default, OptionsMetadata, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Default, OptionsMetadata, Serialize, Deserialize)]
@ -362,7 +362,6 @@ pub struct Options {
line-length = 120 line-length = 120
"# "#
)] )]
#[cfg_attr(feature = "schemars", schemars(range(min = 1, max = 320)))]
pub line_length: Option<LineLength>, pub line_length: Option<LineLength>,
/// The tabulation size to calculate line length. /// The tabulation size to calculate line length.

4
ruff.schema.json generated
View file

@ -392,9 +392,7 @@
{ {
"type": "null" "type": "null"
} }
], ]
"maximum": 320.0,
"minimum": 1.0
}, },
"lint": { "lint": {
"anyOf": [ "anyOf": [