Please review below for developer guidelines on general project contribution guidelines as well as writing your own marshalls plugin.
A Marshall always extends the BaseMarshall class and needs to implement the following interface:
title(): string
isEnabled(ctx: object): boolean
run(ctx: object, task: object): Promise<>
for reference about the ctx
and task
objects passed to tasks refer to listr package documentation.
The run()
method must be able to support multiple packages provided in ctx.pkgs
to run its check upon.
If you implement multiple packages checks with a Promise.all()
strategy you should be aware that it will fail-fast on exceptions. This default behavior is not desirable because while errors exist in one packge, you would still want to continue running your checks on the other packages as well.
To mitigate that, your specific check method should now throw an exception if it fails, but instead catch it and call
this.setMessage({
pkg: pkg,
message: err.message
})
to record an error that happened in a specific package.
- Never overwrite
ctx.pkgs
property
Make sure you the code you're adding has decent test coverage.
Running project tests and coverage:
npm run test
The project uses the commitizen tool for standardizing changelog style commit messages so you should follow it as so:
git add . # add files to staging
yarn run commit # use the wizard for the commit message