mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-07 09:00:31 +00:00
Include individual path checks in --verbose logging (#3489)
This commit is contained in:
parent
a6e998d639
commit
1e5db58b7b
4 changed files with 6 additions and 7 deletions
|
@ -128,7 +128,7 @@ pub fn resolve_configuration(
|
||||||
|
|
||||||
// Resolve the current path.
|
// Resolve the current path.
|
||||||
let options = pyproject::load_options(&path)
|
let options = pyproject::load_options(&path)
|
||||||
.map_err(|err| anyhow!("Failed to parse `{}`: {}", path.to_string_lossy(), err))?;
|
.map_err(|err| anyhow!("Failed to parse `{}`: {}", path.display(), err))?;
|
||||||
let project_root = relativity.resolve(&path);
|
let project_root = relativity.resolve(&path);
|
||||||
let configuration = Configuration::from_options(options, &project_root)?;
|
let configuration = Configuration::from_options(options, &project_root)?;
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ pub fn add_noqa(
|
||||||
match add_noqa_to_path(path, package, settings) {
|
match add_noqa_to_path(path, package, settings) {
|
||||||
Ok(count) => Some(count),
|
Ok(count) => Some(count),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("Failed to add noqa to {}: {e}", path.to_string_lossy());
|
error!("Failed to add noqa to {}: {e}", path.display());
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,10 +44,7 @@ pub fn run(
|
||||||
if cache.into() {
|
if cache.into() {
|
||||||
fn init_cache(path: &std::path::Path) {
|
fn init_cache(path: &std::path::Path) {
|
||||||
if let Err(e) = cache::init(path) {
|
if let Err(e) = cache::init(path) {
|
||||||
error!(
|
error!("Failed to initialize cache at {}: {e:?}", path.display());
|
||||||
"Failed to initialize cache at {}: {e:?}",
|
|
||||||
path.to_string_lossy()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ pub fn lint_path(
|
||||||
if let Some(messages) =
|
if let Some(messages) =
|
||||||
cache::get(path, package.as_ref(), &metadata, settings, autofix.into())
|
cache::get(path, package.as_ref(), &metadata, settings, autofix.into())
|
||||||
{
|
{
|
||||||
debug!("Cache hit for: {}", path.to_string_lossy());
|
debug!("Cache hit for: {}", path.display());
|
||||||
return Ok(Diagnostics::new(messages));
|
return Ok(Diagnostics::new(messages));
|
||||||
}
|
}
|
||||||
Some(metadata)
|
Some(metadata)
|
||||||
|
@ -82,6 +82,8 @@ pub fn lint_path(
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
debug!("Checking: {}", path.display());
|
||||||
|
|
||||||
// Read the file from disk.
|
// Read the file from disk.
|
||||||
let contents = std::fs::read_to_string(path)?;
|
let contents = std::fs::read_to_string(path)?;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue