mirror of https://github.com/astral-sh/ruff
merge with main
This commit is contained in:
parent
daeb3ff37e
commit
67444143b5
|
|
@ -1,13 +1,9 @@
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use ruff_macros::{derive_message_formats, violation};
|
use ruff_macros::{derive_message_formats, violation};
|
||||||
use ruff_python_ast::helpers::unparse_constant;
|
use ruff_python_ast::helpers::{unparse_constant, unparse_expr};
|
||||||
use ruff_python_ast::helpers::unparse_expr;
|
|
||||||
use ruff_python_ast::types::Range;
|
|
||||||
use rustpython_parser::ast::{Cmpop, Constant, Expr, ExprKind, Located};
|
use rustpython_parser::ast::{Cmpop, Constant, Expr, ExprKind, Located};
|
||||||
|
|
||||||
use crate::checkers::ast::Checker;
|
use crate::{checkers::ast::Checker, registry::Diagnostic, violation::Violation};
|
||||||
use crate::registry::Diagnostic;
|
|
||||||
use crate::violation::Violation;
|
|
||||||
|
|
||||||
use super::comparison_of_constant::ViolationsCmpop;
|
use super::comparison_of_constant::ViolationsCmpop;
|
||||||
|
|
||||||
|
|
@ -55,7 +51,7 @@ pub fn compare_to_empty_string(
|
||||||
op: op.into(),
|
op: op.into(),
|
||||||
rhs: unparse_constant(value, checker.stylist),
|
rhs: unparse_constant(value, checker.stylist),
|
||||||
},
|
},
|
||||||
Range::from_located(lhs),
|
lhs.into(),
|
||||||
);
|
);
|
||||||
checker.diagnostics.push(diag);
|
checker.diagnostics.push(diag);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue