Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Short rule messages should not end with a period #9345

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Violation for UnnecessaryComprehensionAnyAll {

#[derive_message_formats]
fn message(&self) -> String {
format!("Unnecessary list comprehension.")
format!("Unnecessary list comprehension")
}

fn fix_title(&self) -> Option<String> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs
---
C419.py:1:5: C419 [*] Unnecessary list comprehension.
C419.py:1:5: C419 [*] Unnecessary list comprehension
|
1 | any([x.id for x in bar])
| ^^^^^^^^^^^^^^^^^^^ C419
Expand All @@ -17,7 +17,7 @@ C419.py:1:5: C419 [*] Unnecessary list comprehension.
3 3 | any( # first comment
4 4 | [x.id for x in bar], # second comment

C419.py:2:5: C419 [*] Unnecessary list comprehension.
C419.py:2:5: C419 [*] Unnecessary list comprehension
|
1 | any([x.id for x in bar])
2 | all([x.id for x in bar])
Expand All @@ -35,7 +35,7 @@ C419.py:2:5: C419 [*] Unnecessary list comprehension.
4 4 | [x.id for x in bar], # second comment
5 5 | ) # third comment

C419.py:4:5: C419 [*] Unnecessary list comprehension.
C419.py:4:5: C419 [*] Unnecessary list comprehension
|
2 | all([x.id for x in bar])
3 | any( # first comment
Expand All @@ -56,7 +56,7 @@ C419.py:4:5: C419 [*] Unnecessary list comprehension.
6 6 | all( # first comment
7 7 | [x.id for x in bar], # second comment

C419.py:7:5: C419 [*] Unnecessary list comprehension.
C419.py:7:5: C419 [*] Unnecessary list comprehension
|
5 | ) # third comment
6 | all( # first comment
Expand All @@ -77,7 +77,7 @@ C419.py:7:5: C419 [*] Unnecessary list comprehension.
9 9 | any({x.id for x in bar})
10 10 |

C419.py:9:5: C419 [*] Unnecessary list comprehension.
C419.py:9:5: C419 [*] Unnecessary list comprehension
|
7 | [x.id for x in bar], # second comment
8 | ) # third comment
Expand All @@ -98,7 +98,7 @@ C419.py:9:5: C419 [*] Unnecessary list comprehension.
11 11 | # OK
12 12 | all(x.id for x in bar)

C419.py:24:5: C419 [*] Unnecessary list comprehension.
C419.py:24:5: C419 [*] Unnecessary list comprehension
|
22 | # Special comment handling
23 | any(
Expand Down Expand Up @@ -133,7 +133,7 @@ C419.py:24:5: C419 [*] Unnecessary list comprehension.
31 30 | )
32 31 |

C419.py:35:5: C419 [*] Unnecessary list comprehension.
C419.py:35:5: C419 [*] Unnecessary list comprehension
|
33 | # Weird case where the function call, opening bracket, and comment are all
34 | # on the same line.
Expand Down
4 changes: 2 additions & 2 deletions crates/ruff_linter/src/rules/ruff/rules/invalid_index_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ impl Violation for InvalidIndexType {
is_slice,
} = self;
if *is_slice {
format!("Slice in indexed access to type `{value_type}` uses type `{index_type}` instead of an integer.")
format!("Slice in indexed access to type `{value_type}` uses type `{index_type}` instead of an integer")
} else {
format!(
"Indexed access to type `{value_type}` uses type `{index_type}` instead of an integer or slice."
"Indexed access to type `{value_type}` uses type `{index_type}` instead of an integer or slice"
)
}
}
Expand Down
Loading
Loading