Properties
message
Required
A string that will be shown as the default title for the check when running the CLI and Commonality Studio.
validate
Required
The validate function is used to set the check’s status to pass
, warn
, or fail
.
The validate
function will be run against all packages matching a selector.
This function can be asynchronous.
Parameters
An object containing metadata about the package the check is being run against.
Returns
If the function returnstrue
, the check will be set to pass
.
If the function returns any other value, the check will be set to warn
or fail
based on the configured level.
fix
A check’s fix
function will only run on packages that where the check’s validate function has returned a falsey value. This function should update packages so that they pass the check’s validate function.
This function can be asynchronous.
Parameters
An object containing metadata about the package the check is being run against.
level
A string that can be set to “warning” or “error”.
If set to "error"
, the CLI will exit with a non-zero exit code if this check is ever invalid. Default is "warning"
.