Add line-length to E501 documentation (#6949)

Closes https://github.com/astral-sh/ruff/issues/6908.
This commit is contained in:
Charlie Marsh 2023-08-28 14:45:30 -04:00 committed by GitHub
parent e1db036f90
commit 005e21a139
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -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:`).

View file

@ -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`
///