mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-16 23:36:03 +00:00
refactor: Add Copy implementation to Rule (#3556)
This commit is contained in:
parent
aa51ecedc5
commit
eff84442bc
59 changed files with 835 additions and 965 deletions
|
@ -16,7 +16,7 @@ struct Explanation<'a> {
|
|||
}
|
||||
|
||||
/// Explain a `Rule` to the user.
|
||||
pub fn rule(rule: &Rule, format: HelpFormat) -> Result<()> {
|
||||
pub fn rule(rule: Rule, format: HelpFormat) -> Result<()> {
|
||||
let (linter, _) = Linter::parse_code(&rule.noqa_code().to_string()).unwrap();
|
||||
let mut stdout = BufWriter::new(io::stdout().lock());
|
||||
let mut output = String::new();
|
||||
|
|
|
@ -105,7 +105,7 @@ pub fn run(
|
|||
":".bold()
|
||||
);
|
||||
let settings = resolver.resolve(path, pyproject_strategy);
|
||||
if settings.rules.enabled(&Rule::IOError) {
|
||||
if settings.rules.enabled(Rule::IOError) {
|
||||
Diagnostics::new(vec![Message::from_diagnostic(
|
||||
Diagnostic::new(
|
||||
IOError { message },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue