-
Notifications
You must be signed in to change notification settings - Fork 80
Sourcery configuration
Sourcery reads configuration settings from .sourcery.yaml
in the project directory.
The config file uses YAML syntax. If you are new to YAML see "Learn YAML in 5 minutes".
Here are the default settings that will be used if the config file doesn't exist, or if a setting isn't included in the config file:
ignore: []
refactor:
skip: []
github:
labels: []
ignore_labels: [sourcery-ignore]
request_review: none
sourcery_branch: sourcery/{base_branch}
These are general settings that apply both to editor plugins and the GitHub Bot:
These change how refactoring works and apply to editor plugins and the GitHub Bot:
These apply just to the GitHub Bot:
Paths that Sourcery will ignore and won't be refactored.
The GitHub Bot always ignores .github/workflows/*
as the workflows folder cannot be updated by bots.
ignore:
- data/*
- .venv/*
Refactoring ids to skip. These refactoring ids are displayed in the plugin suggestions and GitHub Bot comments for easy lookup.
These refactorings will never be suggested by Sourcery.
refactor:
skip:
- assign-if-exp
- de-morgan
It is also possible to skip refactorings in the code using skip comments.
Labels to ignore.
PRs with any of these labels will be ignored by Sourcery.
github:
ignore_labels:
- sourcery-ignore
Add labels to any PRs create by Sourcery.
These can be used to tell other automation to avoid our PRs.
github:
labels:
- build-ignore
Request review on created Sourcery PRs
Possible values:
-
none
- don't request a review - the default -
author
- the author of the original PR or the sender of the refactor request -
owner
- the owner of the base repository - this is not valid for organizations -
user@name
- a specific user -
team@name
- a specific team
One value will apply to both origin and forked PRs:
github:
request_review: author
Or you can also specify separate values:
github:
request_review:
origin: author
forked: owner
Name Sourcery Pull Request branches.
This must contain {base_branch} which will be replaced with the branch name on the original Pull Request.
github:
sourcery_branch: sourcery/{base_branch}
Please visit our newer docs at https://docs.sourcery.ai