modules/warnings: add a way to bypass module-level assertions as well
This commit is contained in:
@@ -8,8 +8,20 @@
|
|||||||
list of `config.warnings` values you want to ignore, verbatim.
|
list of `config.warnings` values you want to ignore, verbatim.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
sane.silencedAssertions = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
list of `config.assertions` values you want to ignore, keyed by `message`, interpreted as a regex.
|
||||||
|
'';
|
||||||
|
};
|
||||||
warnings = mkOption {
|
warnings = mkOption {
|
||||||
apply = builtins.filter (w: !(builtins.elem w config.sane.silencedWarnings));
|
apply = builtins.filter (w: !(builtins.elem w config.sane.silencedWarnings));
|
||||||
};
|
};
|
||||||
|
assertions = mkOption {
|
||||||
|
# N.B.: don't evaluation `<assertion>.message` before checking `<assertion>.assertion`.
|
||||||
|
# valid assertions are (defacto) allowed to have non-evaluatable messages.
|
||||||
|
apply = builtins.filter (a: !(builtins.any (s: !a.assertion && builtins.match s a.message != null) config.sane.silencedAssertions));
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user