Skip to content

Commit

Permalink
Add formatter to line-length documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Oct 24, 2023
1 parent 7f4ea66 commit de85ade
Show file tree
Hide file tree
Showing 15 changed files with 92 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Violation for DocLineTooLong {
#[derive_message_formats]
fn message(&self) -> String {
let DocLineTooLong(width, limit) = self;
format!("Doc line too long ({width} > {limit} characters)")
format!("Doc line too long ({width} > {limit})")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl Violation for LineTooLong {
#[derive_message_formats]
fn message(&self) -> String {
let LineTooLong(width, limit) = self;
format!("Line too long ({width} > {limit} characters)")
format!("Line too long ({width} > {limit})")
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
E501.py:5:89: E501 Line too long (123 > 88 characters)
E501.py:5:89: E501 Line too long (123 > 88)
|
3 | https://github.com/PyCQA/pycodestyle/pull/258/files#diff-841c622497a8033d10152bfdfb15b20b92437ecdea21a260944ea86b77b51533
4 |
Expand All @@ -10,14 +10,14 @@ E501.py:5:89: E501 Line too long (123 > 88 characters)
6 | """
|

E501.py:16:85: E501 Line too long (95 > 88 characters)
E501.py:16:85: E501 Line too long (95 > 88)
|
15 | _ = "---------------------------------------------------------------------------AAAAAAA"
16 | _ = "---------------------------------------------------------------------------亜亜亜亜亜亜亜"
| ^^^^^^^ E501
|

E501.py:25:89: E501 Line too long (127 > 88 characters)
E501.py:25:89: E501 Line too long (127 > 88)
|
23 | caller(
24 | """
Expand All @@ -27,7 +27,7 @@ E501.py:25:89: E501 Line too long (127 > 88 characters)
27 | )
|

E501.py:40:89: E501 Line too long (132 > 88 characters)
E501.py:40:89: E501 Line too long (132 > 88)
|
38 | "Lorem ipsum dolor": "sit amet",
39 | # E501 Line too long
Expand All @@ -37,7 +37,7 @@ E501.py:40:89: E501 Line too long (132 > 88 characters)
42 | "Lorem ipsum dolor": """
|

E501.py:43:89: E501 Line too long (105 > 88 characters)
E501.py:43:89: E501 Line too long (105 > 88)
|
41 | # E501 Line too long
42 | "Lorem ipsum dolor": """
Expand All @@ -47,7 +47,7 @@ E501.py:43:89: E501 Line too long (105 > 88 characters)
45 | # OK
|

E501.py:83:89: E501 Line too long (147 > 88 characters)
E501.py:83:89: E501 Line too long (147 > 88)
|
81 | class Bar:
82 | """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
E501_3.py:11:89: E501 Line too long (89 > 88 characters)
E501_3.py:11:89: E501 Line too long (89 > 88)
|
10 | # Error (89 characters)
11 | "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:aaaa" # type: ignore
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
W505.py:2:51: W505 Doc line too long (57 > 50 characters)
W505.py:2:51: W505 Doc line too long (57 > 50)
|
1 | #!/usr/bin/env python3
2 | """Here's a top-level docstring that's over the limit."""
| ^^^^^^^ W505
|

W505.py:6:51: W505 Doc line too long (56 > 50 characters)
W505.py:6:51: W505 Doc line too long (56 > 50)
|
5 | def f1():
6 | """Here's a docstring that's also over the limit."""
Expand All @@ -17,7 +17,7 @@ W505.py:6:51: W505 Doc line too long (56 > 50 characters)
8 | x = 1 # Here's a comment that's over the limit, but it's not standalone.
|

W505.py:10:51: W505 Doc line too long (56 > 50 characters)
W505.py:10:51: W505 Doc line too long (56 > 50)
|
8 | x = 1 # Here's a comment that's over the limit, but it's not standalone.
9 |
Expand All @@ -27,7 +27,7 @@ W505.py:10:51: W505 Doc line too long (56 > 50 characters)
12 | x = 2
|

W505.py:13:51: W505 Doc line too long (93 > 50 characters)
W505.py:13:51: W505 Doc line too long (93 > 50)
|
12 | x = 2
13 | # Another standalone that is preceded by a newline and indent toke and is over the limit.
Expand All @@ -36,13 +36,13 @@ W505.py:13:51: W505 Doc line too long (93 > 50 characters)
15 | print("Here's a string that's over the limit, but it's not a docstring.")
|

W505.py:18:51: W505 Doc line too long (61 > 50 characters)
W505.py:18:51: W505 Doc line too long (61 > 50)
|
18 | "This is also considered a docstring, and is over the limit."
| ^^^^^^^^^^^ W505
|

W505.py:24:51: W505 Doc line too long (82 > 50 characters)
W505.py:24:51: W505 Doc line too long (82 > 50)
|
22 | """Here's a multi-line docstring.
23 |
Expand All @@ -51,7 +51,7 @@ W505.py:24:51: W505 Doc line too long (82 > 50 characters)
25 | """
|

W505.py:31:51: W505 Doc line too long (85 > 50 characters)
W505.py:31:51: W505 Doc line too long (85 > 50)
|
29 | """Here's a multi-line docstring.
30 |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
W505_utf_8.py:2:50: W505 Doc line too long (57 > 50 characters)
W505_utf_8.py:2:50: W505 Doc line too long (57 > 50)
|
1 | #!/usr/bin/env python3
2 | """Here's a top-level ß9💣2ℝing that's over theß9💣2ℝ."""
| ^^^^^^ W505
|

W505_utf_8.py:6:49: W505 Doc line too long (56 > 50 characters)
W505_utf_8.py:6:49: W505 Doc line too long (56 > 50)
|
5 | def f1():
6 | """Here's a ß9💣2ℝing that's also over theß9💣2ℝ."""
Expand All @@ -17,7 +17,7 @@ W505_utf_8.py:6:49: W505 Doc line too long (56 > 50 characters)
8 | x = 1 # Here's a comment that's over theß9💣2ℝ, but it's not standalone.
|

W505_utf_8.py:10:51: W505 Doc line too long (56 > 50 characters)
W505_utf_8.py:10:51: W505 Doc line too long (56 > 50)
|
8 | x = 1 # Here's a comment that's over theß9💣2ℝ, but it's not standalone.
9 |
Expand All @@ -27,7 +27,7 @@ W505_utf_8.py:10:51: W505 Doc line too long (56 > 50 characters)
12 | x = 2
|

W505_utf_8.py:13:51: W505 Doc line too long (93 > 50 characters)
W505_utf_8.py:13:51: W505 Doc line too long (93 > 50)
|
12 | x = 2
13 | # Another standalone that is preceded by a newline and indent toke and is over theß9💣2ℝ.
Expand All @@ -36,13 +36,13 @@ W505_utf_8.py:13:51: W505 Doc line too long (93 > 50 characters)
15 | print("Here's a string that's over theß9💣2ℝ, but it's not a ß9💣2ℝing.")
|

W505_utf_8.py:18:50: W505 Doc line too long (61 > 50 characters)
W505_utf_8.py:18:50: W505 Doc line too long (61 > 50)
|
18 | "This is also considered a ß9💣2ℝing, and is over theß9💣2ℝ."
| ^^^^^^^^^^^ W505
|

W505_utf_8.py:24:50: W505 Doc line too long (82 > 50 characters)
W505_utf_8.py:24:50: W505 Doc line too long (82 > 50)
|
22 | """Here's a multi-line ß9💣2ℝing.
23 |
Expand All @@ -51,7 +51,7 @@ W505_utf_8.py:24:50: W505 Doc line too long (82 > 50 characters)
25 | """
|

W505_utf_8.py:31:50: W505 Doc line too long (85 > 50 characters)
W505_utf_8.py:31:50: W505 Doc line too long (85 > 50)
|
29 | """Here's a multi-line ß9💣2ℝing.
30 |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
E501_2.py:2:7: E501 Line too long (7 > 6 characters)
E501_2.py:2:7: E501 Line too long (7 > 6)
|
1 | # aaaa
2 | # aaaaa
Expand All @@ -10,7 +10,7 @@ E501_2.py:2:7: E501 Line too long (7 > 6 characters)
4 | # a
|

E501_2.py:3:7: E501 Line too long (7 > 6 characters)
E501_2.py:3:7: E501 Line too long (7 > 6)
|
1 | # aaaa
2 | # aaaaa
Expand All @@ -20,7 +20,7 @@ E501_2.py:3:7: E501 Line too long (7 > 6 characters)
5 | # aa
|

E501_2.py:7:7: E501 Line too long (7 > 6 characters)
E501_2.py:7:7: E501 Line too long (7 > 6)
|
5 | # aa
6 | # aaa
Expand All @@ -30,7 +30,7 @@ E501_2.py:7:7: E501 Line too long (7 > 6 characters)
9 | # aa
|

E501_2.py:10:7: E501 Line too long (7 > 6 characters)
E501_2.py:10:7: E501 Line too long (7 > 6)
|
8 | # a
9 | # aa
Expand All @@ -40,7 +40,7 @@ E501_2.py:10:7: E501 Line too long (7 > 6 characters)
12 | if True: # noqa: E501
|

E501_2.py:16:7: E501 Line too long (7 > 6 characters)
E501_2.py:16:7: E501 Line too long (7 > 6)
|
14 | [12 ]
15 | [1,2]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
E501_2.py:2:7: E501 Line too long (7 > 6 characters)
E501_2.py:2:7: E501 Line too long (7 > 6)
|
1 | # aaaa
2 | # aaaaa
Expand All @@ -10,7 +10,7 @@ E501_2.py:2:7: E501 Line too long (7 > 6 characters)
4 | # a
|

E501_2.py:3:7: E501 Line too long (7 > 6 characters)
E501_2.py:3:7: E501 Line too long (7 > 6)
|
1 | # aaaa
2 | # aaaaa
Expand All @@ -20,7 +20,7 @@ E501_2.py:3:7: E501 Line too long (7 > 6 characters)
5 | # aa
|

E501_2.py:6:6: E501 Line too long (7 > 6 characters)
E501_2.py:6:6: E501 Line too long (7 > 6)
|
4 | # a
5 | # aa
Expand All @@ -30,7 +30,7 @@ E501_2.py:6:6: E501 Line too long (7 > 6 characters)
8 | # a
|

E501_2.py:7:6: E501 Line too long (8 > 6 characters)
E501_2.py:7:6: E501 Line too long (8 > 6)
|
5 | # aa
6 | # aaa
Expand All @@ -40,7 +40,7 @@ E501_2.py:7:6: E501 Line too long (8 > 6 characters)
9 | # aa
|

E501_2.py:8:5: E501 Line too long (7 > 6 characters)
E501_2.py:8:5: E501 Line too long (7 > 6)
|
6 | # aaa
7 | # aaaa
Expand All @@ -50,7 +50,7 @@ E501_2.py:8:5: E501 Line too long (7 > 6 characters)
10 | # aaa
|

E501_2.py:9:5: E501 Line too long (8 > 6 characters)
E501_2.py:9:5: E501 Line too long (8 > 6)
|
7 | # aaaa
8 | # a
Expand All @@ -59,7 +59,7 @@ E501_2.py:9:5: E501 Line too long (8 > 6 characters)
10 | # aaa
|

E501_2.py:10:5: E501 Line too long (9 > 6 characters)
E501_2.py:10:5: E501 Line too long (9 > 6)
|
8 | # a
9 | # aa
Expand All @@ -69,7 +69,7 @@ E501_2.py:10:5: E501 Line too long (9 > 6 characters)
12 | if True: # noqa: E501
|

E501_2.py:14:6: E501 Line too long (7 > 6 characters)
E501_2.py:14:6: E501 Line too long (7 > 6)
|
12 | if True: # noqa: E501
13 | [12]
Expand All @@ -79,7 +79,7 @@ E501_2.py:14:6: E501 Line too long (7 > 6 characters)
16 | [1, 2]
|

E501_2.py:16:6: E501 Line too long (8 > 6 characters)
E501_2.py:16:6: E501 Line too long (8 > 6)
|
14 | [12 ]
15 | [1,2]
Expand Down

0 comments on commit de85ade

Please sign in to comment.