Skip to content

Commit

Permalink
Add Applicability to flake8_quotes fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
evanrittenhouse committed Jun 15, 2023
1 parent 107a295 commit c0af0df
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions crates/ruff/src/rules/flake8_quotes/rules/from_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,7 @@ fn docstring(locator: &Locator, range: TextRange, settings: &Settings) -> Option
fixed_contents.push_str(&quote);
fixed_contents.push_str(string_contents);
fixed_contents.push_str(&quote);
#[allow(deprecated)]
diagnostic.set_fix(Fix::unspecified(Edit::range_replacement(
fixed_contents,
range,
)));
diagnostic.set_fix(Fix::manual(Edit::range_replacement(fixed_contents, range)));
}
Some(diagnostic)
}
Expand Down Expand Up @@ -358,11 +354,7 @@ fn strings(locator: &Locator, sequence: &[TextRange], settings: &Settings) -> Ve
fixed_contents.push_str(quote);
fixed_contents.push_str(string_contents);
fixed_contents.push_str(quote);
#[allow(deprecated)]
diagnostic.set_fix(Fix::unspecified(Edit::range_replacement(
fixed_contents,
*range,
)));
diagnostic.set_fix(Fix::manual(Edit::range_replacement(fixed_contents, *range)));
}
diagnostics.push(diagnostic);
} else {
Expand Down Expand Up @@ -425,11 +417,8 @@ fn strings(locator: &Locator, sequence: &[TextRange], settings: &Settings) -> Ve

fixed_contents.push(quote);

#[allow(deprecated)]
diagnostic.set_fix(Fix::unspecified(Edit::range_replacement(
fixed_contents,
*range,
)));
diagnostic
.set_fix(Fix::manual(Edit::range_replacement(fixed_contents, *range)));
}
diagnostics.push(diagnostic);
}
Expand All @@ -452,11 +441,8 @@ fn strings(locator: &Locator, sequence: &[TextRange], settings: &Settings) -> Ve
fixed_contents.push(quote);
fixed_contents.push_str(string_contents);
fixed_contents.push(quote);
#[allow(deprecated)]
diagnostic.set_fix(Fix::unspecified(Edit::range_replacement(
fixed_contents,
*range,
)));
diagnostic
.set_fix(Fix::manual(Edit::range_replacement(fixed_contents, *range)));
}
diagnostics.push(diagnostic);
}
Expand Down

0 comments on commit c0af0df

Please sign in to comment.