From 005e21a139ac2518887548a529688daaded15a54 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 28 Aug 2023 14:45:30 -0400 Subject: [PATCH] Add `line-length` to E501 documentation (#6949) Closes https://github.com/astral-sh/ruff/issues/6908. --- .../src/rules/pycodestyle/rules/doc_line_too_long.rs | 9 +++------ crates/ruff/src/rules/pycodestyle/rules/line_too_long.rs | 5 ++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/ruff/src/rules/pycodestyle/rules/doc_line_too_long.rs b/crates/ruff/src/rules/pycodestyle/rules/doc_line_too_long.rs index 0faa662370..e4e8b3ae33 100644 --- a/crates/ruff/src/rules/pycodestyle/rules/doc_line_too_long.rs +++ b/crates/ruff/src/rules/pycodestyle/rules/doc_line_too_long.rs @@ -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:`). diff --git a/crates/ruff/src/rules/pycodestyle/rules/line_too_long.rs b/crates/ruff/src/rules/pycodestyle/rules/line_too_long.rs index f18e2d34a9..1b25557e3d 100644 --- a/crates/ruff/src/rules/pycodestyle/rules/line_too_long.rs +++ b/crates/ruff/src/rules/pycodestyle/rules/line_too_long.rs @@ -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` ///