Skip to content

Sourcery configuration

Brendan Maginnis edited this page May 28, 2020 · 19 revisions

Sourcery configuration

Sourcery reads configuration settings from .sourcery.yml in the project directory.

The config file uses YAML syntax. If you are new to YAML see "Learn YAML in 5 minutes".

Default values

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: []

github:
  labels: []
  ignore_labels: [sourcery-ignore]
  sourcery_branch: sourcery/{base_branch}

Sourcery options

These apply both to editor plugins and the GitHub Bot:

GitHub options

These apply just to the GitHub Bot:

ignore

Paths that Sourcery will ignore and won't be refactored.

The GitHub Bot always ignores .github/workflow/* as the workflows folder cannot be updated by bots.

TODO Add description of how this works

ignore: 
  - data/*
  - .venv/*

github.labels

Add labels to any PRs create by Sourcery.

These can be used to tell other automation to avoid our PRs.

github:
  labels:
    - build-ignore

github.ignore_labels

Labels to ignore.

PRs with any of these labels will be ignored by Sourcery.

github:
  ignore_labels:
    - sourcery-ignore

github.sourcery_branch

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}
Clone this wiki locally