mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:22:24 +00:00
Use backticks for code in red-knot messages (#13599)
## Summary ...and remove periods from messages that don't span more than a single sentence. This is more consistent with how we present user-facing messages in uv (which has a defined style guide).
This commit is contained in:
parent
ef45185dbc
commit
c3b40da0d2
22 changed files with 156 additions and 156 deletions
|
@ -226,8 +226,8 @@ print("hello world")
|
|||
assert_eq!(
|
||||
source_map.markers(),
|
||||
&[
|
||||
SourceMarker::new(10.into(), 10.into(),),
|
||||
SourceMarker::new(10.into(), 21.into(),),
|
||||
SourceMarker::new(10.into(), 10.into()),
|
||||
SourceMarker::new(10.into(), 21.into()),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -263,8 +263,8 @@ class A(Bar):
|
|||
assert_eq!(
|
||||
source_map.markers(),
|
||||
&[
|
||||
SourceMarker::new(8.into(), 8.into(),),
|
||||
SourceMarker::new(14.into(), 11.into(),),
|
||||
SourceMarker::new(8.into(), 8.into()),
|
||||
SourceMarker::new(14.into(), 11.into()),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -335,8 +335,8 @@ class A(object):
|
|||
&[
|
||||
SourceMarker::new(8.into(), 8.into()),
|
||||
SourceMarker::new(16.into(), 8.into()),
|
||||
SourceMarker::new(22.into(), 14.into(),),
|
||||
SourceMarker::new(30.into(), 14.into(),),
|
||||
SourceMarker::new(22.into(), 14.into()),
|
||||
SourceMarker::new(30.into(), 14.into()),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -371,8 +371,8 @@ class A:
|
|||
assert_eq!(
|
||||
source_map.markers(),
|
||||
&[
|
||||
SourceMarker::new(7.into(), 7.into(),),
|
||||
SourceMarker::new(15.into(), 7.into(),),
|
||||
SourceMarker::new(7.into(), 7.into()),
|
||||
SourceMarker::new(15.into(), 7.into()),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ mod tests {
|
|||
assert!(!comment_contains_code(
|
||||
"# pylint: disable=redefined-outer-name",
|
||||
&[]
|
||||
),);
|
||||
));
|
||||
assert!(!comment_contains_code(
|
||||
"# Issue #999: This is not code",
|
||||
&[]
|
||||
|
@ -190,11 +190,11 @@ mod tests {
|
|||
assert!(comment_contains_code(
|
||||
"# user_content_type, _ = TimelineEvent.objects.using(db_alias).get_or_create(",
|
||||
&[]
|
||||
),);
|
||||
));
|
||||
assert!(comment_contains_code(
|
||||
"# (user_content_type, _) = TimelineEvent.objects.using(db_alias).get_or_create(",
|
||||
&[]
|
||||
),);
|
||||
));
|
||||
assert!(comment_contains_code(
|
||||
"# ( user_content_type , _ )= TimelineEvent.objects.using(db_alias).get_or_create(",
|
||||
&[]
|
||||
|
|
|
@ -181,7 +181,7 @@ impl AlwaysFixableViolation for MissingTrailingComma {
|
|||
/// import json
|
||||
///
|
||||
///
|
||||
/// foo = (json.dumps({"bar": 1}),)
|
||||
/// foo = (json.dumps({"bar": 1}))
|
||||
/// ```
|
||||
#[violation]
|
||||
pub struct TrailingCommaOnBareTuple;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue