Skip to content

Commit

Permalink
Migrate flake8_bugbear rules to unspecified to suggested (#4616)
Browse files Browse the repository at this point in the history
  • Loading branch information
sladyn98 authored May 24, 2023
1 parent dcd2bfa commit 8c92154
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ pub(crate) fn getattr_with_constant(
}

let mut diagnostic = Diagnostic::new(GetAttrWithConstant, expr.range());

if checker.patch(diagnostic.kind.rule()) {
#[allow(deprecated)]
diagnostic.set_fix(Fix::unspecified(Edit::range_replacement(
diagnostic.set_fix(Fix::suggested(Edit::range_replacement(
checker.generator().expr(&attribute(obj, value)),
expr.range(),
)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ pub(crate) fn setattr_with_constant(
{
if expr == child.as_ref() {
let mut diagnostic = Diagnostic::new(SetAttrWithConstant, expr.range());

if checker.patch(diagnostic.kind.rule()) {
#[allow(deprecated)]
diagnostic.set_fix(Fix::unspecified(Edit::range_replacement(
diagnostic.set_fix(Fix::suggested(Edit::range_replacement(
assignment(obj, name, value, checker.generator()),
expr.range(),
)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
.all(|binding| !binding.is_used())
{
#[allow(deprecated)]
diagnostic.set_fix(Fix::unspecified(Edit::range_replacement(
diagnostic.set_fix(Fix::suggested(Edit::range_replacement(
rename,
expr.range(),
)));
Expand Down

0 comments on commit 8c92154

Please sign in to comment.