-
Notifications
You must be signed in to change notification settings - Fork 74
GitHub
You can install the Sourcery GitHub app directly using this link:
https://github.com/apps/sourcery-ai/installations/new
Sourcery automatically reviews any new PRs made to your repo and will give suggestions on how you can improve your code. Sourcery will only review the changes made in the PR, not your full code base.
To have Sourcery review your whole repository:
- Open up your Sourcery Dashboard
- Select your repo (or add new repos)
- Click the Refactor button
In GitHub you can accept all of Sourcery's suggestions by merging the PR
To add Sourcery to new repos:
- Open up your Sourcery Dashboard
- Click the Add Repo button
- Select the repo you want to add
We know there might be files or paths you don't want Sourcery to refactor - especially things like third party libraries. If you want Sourcery to ignore these you can add a file or a path to the ignore section in the .sourcery.yaml
file in your project directory like this:
```
ignore:
- data/*
- .venv/*
- '*_test.py' # Note that any strings beginning with * must be quoted
```
Sourcery provides quality metrics on every Sourcery PR. Scroll to the bottom of the pull request to see Sourcery's metrics across four different areas:
- Complexity
- Method Length
- Working Memory
- Overall Quality
Sourcery will comment on each pull request scanned with a Quality Report. This details whether the pull request has increased or decreased code quality in the affected files, and gives a breakdown per file. It also shows up to five functions in these files that have a low quality score, and our recommendations for improving them. Please see the Quality Report page for more details on the metrics used and how we calculate the quality score.
Please visit our newer docs at https://docs.sourcery.ai