mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 11:59:10 +00:00
Add maximum length for line-length
to JSON schema (#7412)
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> Adds the maximum of 320 for the line-length setting to the JSON schema for better integration with IDEs. Related https://github.com/astral-sh/ruff/pull/6873 ## Test Plan <!-- How was it tested? -->
This commit is contained in:
parent
f936d319cc
commit
1b082ce67e
2 changed files with 6 additions and 3 deletions
|
@ -319,7 +319,8 @@ pub struct Options {
|
|||
"#
|
||||
)]
|
||||
/// The line length to use when enforcing long-lines violations (like
|
||||
/// `E501`). Must be greater than `0`.
|
||||
/// `E501`). Must be greater than `0` and less than or equal to `320`.
|
||||
#[cfg_attr(feature = "schemars", schemars(range(min = 1, max = 320)))]
|
||||
pub line_length: Option<LineLength>,
|
||||
#[option(
|
||||
default = "4",
|
||||
|
|
6
ruff.schema.json
generated
6
ruff.schema.json
generated
|
@ -376,7 +376,7 @@
|
|||
]
|
||||
},
|
||||
"line-length": {
|
||||
"description": "The line length to use when enforcing long-lines violations (like `E501`). Must be greater than `0`.",
|
||||
"description": "The line length to use when enforcing long-lines violations (like `E501`). Must be greater than `0` and less than or equal to `320`.",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/LineLength"
|
||||
|
@ -384,7 +384,9 @@
|
|||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
],
|
||||
"maximum": 320.0,
|
||||
"minimum": 1.0
|
||||
},
|
||||
"logger-objects": {
|
||||
"description": "A list of objects that should be treated equivalently to a `logging.Logger` object.\n\nThis is useful for ensuring proper diagnostics (e.g., to identify `logging` deprecations and other best-practices) for projects that re-export a `logging.Logger` object from a common module.\n\nFor example, if you have a module `logging_setup.py` with the following contents: ```python import logging\n\nlogger = logging.getLogger(__name__) ```\n\nAdding `\"logging_setup.logger\"` to `logger-objects` will ensure that `logging_setup.logger` is treated as a `logging.Logger` object when imported from other modules (e.g., `from logging_setup import logger`).",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue