Instantly review and improve your Python code to keep your codebase maintainable.
Get started with our CLI to have Sourcery review all your code locally or star this repo to have our GitHub bot review your most popular Python repo
You can have Sourcery review your entire project and make dozens or hundreds (or thousands) of improvements with a single command from the command line.
pip install sourcery-cli, login with
sourcery login, and then run
sourcery review <some path> to have Sourcery review and make suggestions on every file in that path
For CI we recommend using
pip install sourcery-cli # Store your Sourcery token as a secret in your CI environment. sourcery login --token $SOURCERY_TOKEN sourcery review --check --diff "git diff main" .
Or if it’s easier you can check out our GitHub Action!
To set up your pre-commit hooks use:
repos: - repo: https://github.com/sourcery-ai/sourcery rev: v0.13.0 hooks: - id: sourcery # The best way to use Sourcery in a pre-commit hook: # * review only changed lines: # * omit the summary args: [--diff=git diff HEAD, --no-summary]
Note: Sourcery is fully free for open-source projects - but you need a Team plan to use Sourcery in CI or as a pre-commit hook for private projects.
Sourcery integrates into your editor to review and improve your code while you’re writing it
Find quick installation instructions here:
More editor integrations coming soon.
Ensure your code is always at the highest quality. Sourcery reviews and makes suggestions on your whole repo when you install and then checks all new pull requests in the future
You can get set up and running in 1 minute. Just follow this link and select your repos.
Or to try it out right away, ⭐ this repo, and Sourcery will review your most popular Python repo and send you a pull request. As an added bonus @sourcery-ai-bot will ⭐ your repo too.
Let the world know your project is using Sourcery to refactor with this badge: