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

fix lack of not in error message #3497

Merged
merged 3 commits into from
Mar 13, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/ruff/src/rules/pylint/rules/compare_to_empty_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ impl TryFrom<&Cmpop> for EmptyStringCmpop {
impl EmptyStringCmpop {
pub fn into_unary(self) -> &'static str {
match self {
Self::Is | Self::Eq => "",
Self::IsNot | Self::NotEq => "not ",
Self::Is | Self::Eq => "not ",
Self::IsNot | Self::NotEq => "",
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ expression: diagnostics
---
- kind:
name: CompareToEmptyString
body: "`x is \"\"` can be simplified to `x` as an empty string is falsey"
body: "`x is \"\"` can be simplified to `not x` as an empty string is falsey"
suggestion: ~
fixable: false
location:
Expand All @@ -17,7 +17,7 @@ expression: diagnostics
parent: ~
- kind:
name: CompareToEmptyString
body: "`x == \"\"` can be simplified to `x` as an empty string is falsey"
body: "`x == \"\"` can be simplified to `not x` as an empty string is falsey"
suggestion: ~
fixable: false
location:
Expand All @@ -30,7 +30,7 @@ expression: diagnostics
parent: ~
- kind:
name: CompareToEmptyString
body: "`y is not \"\"` can be simplified to `not y` as an empty string is falsey"
body: "`y is not \"\"` can be simplified to `y` as an empty string is falsey"
suggestion: ~
fixable: false
location:
Expand All @@ -43,7 +43,7 @@ expression: diagnostics
parent: ~
- kind:
name: CompareToEmptyString
body: "`y != \"\"` can be simplified to `not y` as an empty string is falsey"
body: "`y != \"\"` can be simplified to `y` as an empty string is falsey"
suggestion: ~
fixable: false
location:
Expand All @@ -56,7 +56,7 @@ expression: diagnostics
parent: ~
- kind:
name: CompareToEmptyString
body: "`\"\" != z` can be simplified to `not z` as an empty string is falsey"
body: "`\"\" != z` can be simplified to `z` as an empty string is falsey"
suggestion: ~
fixable: false
location:
Expand Down