Using Sourcery in Your CI¶
By setting up Sourcery in your CI, you can:
- ensure that only code following your best practices gets deployed to production
- set high quality standards for your pull requests without getting noise from issues in your legacy code
- finetune your quality gates to ensure your most important best practices are always followed
An example script to set up Sourcery in your CI to review only the code in your current PR:
pip install sourcery
# Store your Sourcery token as a secret in your CI environment.
sourcery login --token $SOURCERY_TOKEN
sourcery review --check --diff "git diff main" .
For more details and configuration options, check out the Getting Started with the CI guide.