mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 20:42:10 +00:00
Avoid parenthesizing multiline strings in binary expressions (#6973)
This commit is contained in:
parent
e2b2b1759f
commit
eb552da8a9
6 changed files with 315 additions and 40 deletions
|
@ -330,6 +330,17 @@ impl<'a> Comments<'a> {
|
|||
Self::new(map)
|
||||
}
|
||||
|
||||
/// Returns `true` if the given `node` has any comments.
|
||||
#[inline]
|
||||
pub(crate) fn has<T>(&self, node: T) -> bool
|
||||
where
|
||||
T: Into<AnyNodeRef<'a>>,
|
||||
{
|
||||
self.data
|
||||
.comments
|
||||
.has(&NodeRefEqualityKey::from_ref(node.into()))
|
||||
}
|
||||
|
||||
/// Returns `true` if the given `node` has any [leading comments](self#leading-comments).
|
||||
#[inline]
|
||||
pub(crate) fn has_leading<T>(&self, node: T) -> bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue