Skip to content

Commit

Permalink
feat: add lint_message.name to oneline output (#21)
Browse files Browse the repository at this point in the history
* feat: add lint_message.name to oneline output

One scenario when oneline outputs are useful is when we adopt new linters. We typically need to disable rules inline when introducing linters like mypy. This adds the message `name` so users can copy and paste the violated rules to ignore it.

* Update integration_test__simple_linter_oneline.snap
  • Loading branch information
justinchuby authored Nov 28, 2022
1 parent 032bea6 commit 84f3d34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ pub fn render_lint_messages_oneline(

writeln!(
stdout,
"{}:{}:{}:{} {} [{}]",
display_path, line_number, column, severity, description, lint_message.code
"{}:{}:{}:{} {} [{}/{}]",
display_path, line_number, column, severity, description, lint_message.code, lint_message.name
)?;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ expression: output_lines

---
- "STDOUT:"
- "tests/fixtures/fake_source_file.rs:9:1:Advice A dummy linter failure [DUMMY]"
- "tests/fixtures/fake_source_file.rs:9:1:Advice A dummy linter failure [DUMMY/dummy failure]"
- ""
- ""
- "STDERR:"
Expand Down

0 comments on commit 84f3d34

Please sign in to comment.