Include individual path checks in --verbose logging (#3489)

This commit is contained in:
Charlie Marsh 2023-03-13 17:13:47 -04:00 committed by GitHub
parent a6e998d639
commit 1e5db58b7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 7 deletions

View file

@ -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)?;

View file

@ -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
} }
} }

View file

@ -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()
);
} }
} }

View file

@ -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)?;