mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:22:24 +00:00
Add line-length
to E501 documentation (#6949)
Closes https://github.com/astral-sh/ruff/issues/6908.
This commit is contained in:
parent
e1db036f90
commit
005e21a139
2 changed files with 7 additions and 7 deletions
|
@ -11,7 +11,9 @@ use crate::settings::Settings;
|
|||
/// ## Why is this bad?
|
||||
/// For flowing long blocks of text (docstrings or comments), overlong lines
|
||||
/// can hurt readability. [PEP 8], for example, recommends that such lines be
|
||||
/// limited to 72 characters.
|
||||
/// limited to 72 characters, while this rule enforces the limit specified by
|
||||
/// the [`pycodestyle.max-doc-length`] setting. (If no value is provided, this
|
||||
/// rule will be ignored, even if it's added to your `--select` list.)
|
||||
///
|
||||
/// In the context of this rule, a "doc line" is defined as a line consisting
|
||||
/// of either a standalone comment or a standalone string, like a docstring.
|
||||
|
@ -22,11 +24,6 @@ use crate::settings::Settings;
|
|||
/// characters), and lines that end with a URL (as long as the URL starts
|
||||
/// before the line-length threshold).
|
||||
///
|
||||
/// Note that this rule will only be enforced after providing a value for
|
||||
/// [`pycodestyle.max-doc-length`] in your Ruff configuration file. If no
|
||||
/// value is provided, this rule will be ignored, even if it's added to your
|
||||
/// `--select` list.
|
||||
///
|
||||
/// If [`pycodestyle.ignore-overlong-task-comments`] is `true`, this rule will
|
||||
/// also ignore comments that start with any of the specified [`task-tags`]
|
||||
/// (e.g., `# TODO:`).
|
||||
|
|
|
@ -10,7 +10,9 @@ use crate::settings::Settings;
|
|||
///
|
||||
/// ## Why is this bad?
|
||||
/// Overlong lines can hurt readability. [PEP 8], for example, recommends
|
||||
/// limiting lines to 79 characters.
|
||||
/// limiting lines to 79 characters. By default, this rule enforces a limit
|
||||
/// of 88 characters for compatibility with Black, though that limit is
|
||||
/// configurable via the [`line-length`] setting.
|
||||
///
|
||||
/// In the interest of pragmatism, this rule makes a few exceptions when
|
||||
/// determining whether a line is overlong. Namely, it ignores lines that
|
||||
|
@ -36,6 +38,7 @@ use crate::settings::Settings;
|
|||
/// ```
|
||||
///
|
||||
/// ## Options
|
||||
/// - `line-length`
|
||||
/// - `task-tags`
|
||||
/// - `pycodestyle.ignore-overlong-task-comments`
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue