Skip to content

Using Sourcery for GitHub

How does it work?

Sourcery analyzes your code for potential refactoring opportunities and opens a new pull request with suggested refactoring improvements. Sourcery can scan and review new pull requests and/or can scan all the code in any branch of your repo.

Sourcery will scan every new pull request. If it finds suggestions in the changed files, it will create a new PR branched off the new PR branch. This PR can then be reviewed and merged into your PR.

At any time you can request a review and refactoring of any branch in your repo. Sourcery will scan the full branch and open a PR with any proposed refactorings.

Requesting a branch refactoring

Quality Report

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.

Configuration

See Sourcery configuration for details on the .sourcery.yaml configuration file.

The Sourcery configuration file allows you to customize which refactorings you see and control which files or path Sourcery will attempt to refactor.

Back to top