mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-26 02:51:08 -05:00
feat(cli): Log the policy
This is in part to help in cases like #487 but it will also help people generally configure and debug their config.
This commit is contained in:
parent
778fd7a53d
commit
a17f6a284a
1 changed files with 12 additions and 2 deletions
|
@ -313,8 +313,18 @@ impl DirConfig {
|
|||
.and_then(|g| g.file_type_def())
|
||||
.map(|f| f.name());
|
||||
|
||||
name.and_then(|name| self.types.get(name).copied())
|
||||
.unwrap_or(self.default)
|
||||
name.and_then(|name| {
|
||||
log::debug!("{}: `{}` policy", path.display(), name);
|
||||
self.types.get(name).copied()
|
||||
})
|
||||
.unwrap_or_else(|| {
|
||||
log::debug!(
|
||||
"{}: default policy for `{}` file type",
|
||||
path.display(),
|
||||
name.unwrap_or("<unknown>")
|
||||
);
|
||||
self.default
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue