mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 04:19:18 +00:00
Migrate flake8_bugbear rules to unspecified
to suggested
(#4616)
This commit is contained in:
parent
dcd2bfaab7
commit
8c9215489e
3 changed files with 3 additions and 8 deletions
|
@ -64,10 +64,8 @@ pub(crate) fn getattr_with_constant(
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut diagnostic = Diagnostic::new(GetAttrWithConstant, expr.range());
|
let mut diagnostic = Diagnostic::new(GetAttrWithConstant, expr.range());
|
||||||
|
|
||||||
if checker.patch(diagnostic.kind.rule()) {
|
if checker.patch(diagnostic.kind.rule()) {
|
||||||
#[allow(deprecated)]
|
diagnostic.set_fix(Fix::suggested(Edit::range_replacement(
|
||||||
diagnostic.set_fix(Fix::unspecified(Edit::range_replacement(
|
|
||||||
checker.generator().expr(&attribute(obj, value)),
|
checker.generator().expr(&attribute(obj, value)),
|
||||||
expr.range(),
|
expr.range(),
|
||||||
)));
|
)));
|
||||||
|
|
|
@ -79,10 +79,8 @@ pub(crate) fn setattr_with_constant(
|
||||||
{
|
{
|
||||||
if expr == child.as_ref() {
|
if expr == child.as_ref() {
|
||||||
let mut diagnostic = Diagnostic::new(SetAttrWithConstant, expr.range());
|
let mut diagnostic = Diagnostic::new(SetAttrWithConstant, expr.range());
|
||||||
|
|
||||||
if checker.patch(diagnostic.kind.rule()) {
|
if checker.patch(diagnostic.kind.rule()) {
|
||||||
#[allow(deprecated)]
|
diagnostic.set_fix(Fix::suggested(Edit::range_replacement(
|
||||||
diagnostic.set_fix(Fix::unspecified(Edit::range_replacement(
|
|
||||||
assignment(obj, name, value, checker.generator()),
|
assignment(obj, name, value, checker.generator()),
|
||||||
expr.range(),
|
expr.range(),
|
||||||
)));
|
)));
|
||||||
|
|
|
@ -160,8 +160,7 @@ pub(crate) fn unused_loop_control_variable(checker: &mut Checker, target: &Expr,
|
||||||
.map(|binding_id| &checker.semantic_model().bindings[binding_id])
|
.map(|binding_id| &checker.semantic_model().bindings[binding_id])
|
||||||
.all(|binding| !binding.is_used())
|
.all(|binding| !binding.is_used())
|
||||||
{
|
{
|
||||||
#[allow(deprecated)]
|
diagnostic.set_fix(Fix::suggested(Edit::range_replacement(
|
||||||
diagnostic.set_fix(Fix::unspecified(Edit::range_replacement(
|
|
||||||
rename,
|
rename,
|
||||||
expr.range(),
|
expr.range(),
|
||||||
)));
|
)));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue