Skip to content

Commit

Permalink
Code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Jun 26, 2024
1 parent 4907e45 commit 02b5c55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/ruff/src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl Serialize for SerializeMessageKindAsTitle {

impl Display for SerializeMessageKindAsTitle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0.as_str())
f.write_str(self.0.as_str())
}
}

Expand Down
11 changes: 3 additions & 8 deletions crates/ruff_linter/src/message/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,10 @@ impl Emitter for GithubEmitter {
)?;

if let Some(rule) = message.rule() {
writeln!(
writer,
" {code} {body}",
code = rule.noqa_code(),
body = message.body()
)?;
} else {
writeln!(writer, " {}", message.body())?;
write!(writer, " {}", rule.noqa_code())?;
}

writeln!(writer, " {}", message.body())?;
}

Ok(())
Expand Down
1 change: 1 addition & 0 deletions crates/ruff_workspace/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,7 @@ mod tests {
Rule::AmbiguousClassName,
Rule::AmbiguousFunctionName,
Rule::IOError,
Rule::SyntaxError,
Rule::TabIndentation,
Rule::TrailingWhitespace,
Rule::MissingNewlineAtEndOfFile,
Expand Down

0 comments on commit 02b5c55

Please sign in to comment.