Rules can now be tagged by adding a tags key. Then you can include these tags from the CLI to choose a subset of rules to run.
This makes it easy to specify which rules you want to run in CI. First add a tag to the rules you want:
rules:
- id: important-rule
tags:
- ci
pattern: '...'
Then run the ci
tag with sourcery review --include ci .
It is now much easier to configure Sourcery to run in pre-commit or CI. Run:
sourcery init pre-commit
sourcery init ci
include
and exclude
/skip
config and
CLI options. Sourcery's built-in rules carry the built-in
tag.sourcery init
command in CLI - you can now use it to add
pre-commit
config, as well as view instructions to add Sourcery to CI.