mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
Extend reimplemented-starmap
(FURB140
) to catch calls with a single and starred argument (#7768)
This commit is contained in:
parent
3ccd1d580d
commit
e129f77bcf
4 changed files with 128 additions and 23 deletions
|
@ -927,11 +927,7 @@ impl<'a> From<&'a ast::Expr> for ComparableExpr<'a> {
|
|||
}) => Self::Starred(ExprStarred {
|
||||
value: value.into(),
|
||||
}),
|
||||
ast::Expr::Name(ast::ExprName {
|
||||
id,
|
||||
ctx: _,
|
||||
range: _,
|
||||
}) => Self::Name(ExprName { id: id.as_str() }),
|
||||
ast::Expr::Name(name) => name.into(),
|
||||
ast::Expr::List(ast::ExprList {
|
||||
elts,
|
||||
ctx: _,
|
||||
|
@ -968,6 +964,14 @@ impl<'a> From<&'a ast::Expr> for ComparableExpr<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a ast::ExprName> for ComparableExpr<'a> {
|
||||
fn from(expr: &'a ast::ExprName) -> Self {
|
||||
Self::Name(ExprName {
|
||||
id: expr.id.as_str(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Hash)]
|
||||
pub struct StmtFunctionDef<'a> {
|
||||
is_async: bool,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue