Skip to content

Commit

Permalink
Try removing clippy ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Dec 13, 2023
1 parent 3dad7ad commit 16d4bf0
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions crates/ruff_linter/src/message/sarif.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use std::io::Write;

#[cfg(not(target_arch = "wasm32"))]
use url::Url;

#[allow(unused_imports)]
use anyhow::{anyhow, Result};
use anyhow::Result;
use serde::{Serialize, Serializer};
use serde_json::json;

Expand Down Expand Up @@ -127,8 +123,8 @@ impl SarifResult {
rule: message.kind.rule(),
level: "error".to_string(),
message: message.kind.name.clone(),
uri: Url::from_file_path(&path)
.map_err(|()| anyhow!("Failed to convert path to URL: {}", path.display()))?
uri: url::Url::from_file_path(&path)
.map_err(|()| anyhow::anyhow!("Failed to convert path to URL: {}", path.display()))?
.to_string(),
start_line: start_location.row,
start_column: start_location.column,
Expand All @@ -142,12 +138,12 @@ impl SarifResult {
fn from_message(message: &Message) -> Result<Self> {
let start_location = message.compute_start_location();
let end_location = message.compute_end_location();
let abs_filepath = normalize_path(message.filename());
let path = normalize_path(message.filename());
Ok(Self {
rule: message.kind.rule(),
level: "error".to_string(),
message: message.kind.name.clone(),
uri: abs_filepath.display().to_string(),
uri: path.display().to_string(),
start_line: start_location.row,
start_column: start_location.column,
end_line: end_location.row,
Expand Down

0 comments on commit 16d4bf0

Please sign in to comment.