mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +00:00
Introduce SourceFile to avoid cloning the message filename (#3904)
This commit is contained in:
parent
056c212975
commit
c33c9dc585
15 changed files with 296 additions and 271 deletions
|
@ -18,6 +18,7 @@ use ruff::linter::{lint_fix, lint_only, FixTable, FixerResult, LinterResult};
|
|||
use ruff::message::Message;
|
||||
use ruff::settings::{flags, AllSettings, Settings};
|
||||
use ruff_python_ast::imports::ImportMap;
|
||||
use ruff_python_ast::source_code::SourceFileBuilder;
|
||||
|
||||
use crate::cache;
|
||||
|
||||
|
@ -85,8 +86,7 @@ fn load_jupyter_notebook(path: &Path) -> Result<(String, JupyterIndex), Box<Diag
|
|||
return Err(Box::new(Diagnostics {
|
||||
messages: vec![Message::from_diagnostic(
|
||||
*diagnostic,
|
||||
path.to_string_lossy().to_string(),
|
||||
None,
|
||||
SourceFileBuilder::new(&path.to_string_lossy()).finish(),
|
||||
1,
|
||||
)],
|
||||
..Diagnostics::default()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue