Improve debug logging for IgnoreList (#13814)
This commit is contained in:
parent
42c9edaf6e
commit
7acc68a86b
@ -779,6 +779,20 @@ function configFieldIsApplicable(
|
|||||||
return matchesPatterns(context, patterns, dirname);
|
return matchesPatterns(context, patterns, dirname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print the ignoreList-values in a more helpful way than the default.
|
||||||
|
*/
|
||||||
|
function ignoreListReplacer(
|
||||||
|
_key: string,
|
||||||
|
value: IgnoreList | IgnoreItem,
|
||||||
|
): IgnoreList | IgnoreItem | string {
|
||||||
|
if (value instanceof RegExp) {
|
||||||
|
return String(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests if a filename should be ignored based on "ignore" and "only" options.
|
* Tests if a filename should be ignored based on "ignore" and "only" options.
|
||||||
*/
|
*/
|
||||||
@ -793,6 +807,7 @@ function shouldIgnore(
|
|||||||
context.filename ?? "(unknown)"
|
context.filename ?? "(unknown)"
|
||||||
}" because it matches one of \`ignore: ${JSON.stringify(
|
}" because it matches one of \`ignore: ${JSON.stringify(
|
||||||
ignore,
|
ignore,
|
||||||
|
ignoreListReplacer,
|
||||||
)}\` from "${dirname}"`;
|
)}\` from "${dirname}"`;
|
||||||
debug(message);
|
debug(message);
|
||||||
if (context.showConfig) {
|
if (context.showConfig) {
|
||||||
@ -806,6 +821,7 @@ function shouldIgnore(
|
|||||||
context.filename ?? "(unknown)"
|
context.filename ?? "(unknown)"
|
||||||
}" because it fails to match one of \`only: ${JSON.stringify(
|
}" because it fails to match one of \`only: ${JSON.stringify(
|
||||||
only,
|
only,
|
||||||
|
ignoreListReplacer,
|
||||||
)}\` from "${dirname}"`;
|
)}\` from "${dirname}"`;
|
||||||
debug(message);
|
debug(message);
|
||||||
if (context.showConfig) {
|
if (context.showConfig) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user