Tag rules and CLI improvements
Rule tags
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 .
Set up Sourcery in pre-commit and CI
It is now much easier to configure Sourcery to run in pre-commit or CI. Run:
sourcery init pre-commitsourcery init ci
Full changelog
Added
- Docs: custom rule recipe: Enforce Naming Conventions Rules: You can now add
tags to rules,
and include or exclude them with the
includeandexclude/skipconfig and CLI options. Sourcery’s built-in rules carry thebuilt-intag. - IDE: LSP command to login through browser
Changed
- CLI: make rule ids clickable links in non-verbose mode
- CLI: Enhanced
sourcery initcommand in CLI - you can now use it to addpre-commitconfig, as well as view instructions to add Sourcery to CI. - CLI: review: do not print a summary in a pre-commit environment