πŸ“– Usage
Config: Customize Sweep using sweep.yaml

Sweep Config

You can configure Sweep by modifying the sweep.yaml file, which should be in the root directory of your repository.

After making your first Sweep issue, Sweep will make a PR to add the config file for you. If it's not there, you can create it yourself and add the following default config file:

Default content forΒ sweep.yaml
# Sweep AI turns bugs & feature requests into code changes (https://sweep.dev)
# For details on our config file, check out our docs at https://docs.sweep.dev/usage/config
 
# This is the branch that Sweep will develop from and make pull requests to. Most people use 'main' or 'master' but some users also use 'dev' or 'staging'.
branch: 'main'
 
# By default Sweep will read the logs and outputs from your existing Github Actions. To disable this, set this to false.
gha_enabled: True
 
# This is the description of your project. It will be used by sweep when creating PRs. You can tell Sweep what's unique about your project, what frameworks you use, or anything else you want.
#
# Example:
# description: sweepai/sweep is a python project. The main api endpoints are in sweepai/api.py. Write code that adheres to PEP8.
description: ''
 
# This sets whether to create pull requests as drafts. If this is set to True, then all pull requests will be created as drafts and GitHub Actions will not be triggered.
draft: False
 
# This is a list of directories that Sweep will not be able to edit. In our example, Sweep is unable to modify the .github folder as we do not want Sweep to modify our GitHub Actions.
blocked_dirs: [".github/"]
 
# This is a list of documentation links that Sweep will use to help it understand your code. You can add links to documentation for any packages you use here.
#
# Example:
# docs:
#   - Modal: https://modal.com/docs/reference
#   - PyGitHub: https://pygithub.readthedocs.io/en/latest/
docs: []
 
# Sandbox executes commands in a sandboxed environment to validate code changes after every edit to guarantee pristine code. For more details, see the [Sandbox](./sandbox) page.
sandbox:
  install:
    - trunk init
  check:
    - trunk fmt {file_path}
    - trunk check --fix {file_path}
 
# This setting contains a list of rules that Sweep will check for. If any of these rules are broken in a new commit, Sweep will create an pull request to fix the broken rule.
rules:
 - There should not be large sections of commented out code.
 - All docstrings and comments should be up to date.

Config Table

KeyTypeDescription
gha_enabledboolWhether or not to enable GitHub Actions
branchstrThe branch to run on
blocked_dirslistA list of directories to ignore
draftboolWhether or not to create PRs as drafts
descriptionstrThe description of the repository
docsdictA dictionary of documentation links
sandboxdictSandbox settings for validating code changes
rulesdictLeave chores for Sweep by following these rules

gha_enabled

gha_enabled: True

Possible Values: True, False

This setting determines whether or not to enable GitHub Actions. If this is set to False, then Sweep will not read the results of GitHub Actions.

branch

branch: main

This setting determines which branch Sweep will develop from and make pull requests to.

blocked_dirs

blocked_dirs: [".github/", "other_dir"]

This setting lists all of the directories that Sweep will not be able to edit. In our example, Sweep is unable to modify the .github folder as we do not want Sweep to modify our GitHub Actions.

draft

draft: False

Possible Values: True, False

This setting determines whether or not to create pull requests as drafts. If this is set to True, then all pull requests will be created as drafts and GitHub Actions will not be triggered.

description

description: "project description and standards to follow"

This setting is the description of the repository that will be passed to Sweep. Please include details that Sweep may need to understand the repository. You may also include details about standards to follow here.

docs

docs:
  - Modal: ["https://modal.com/docs/reference", "Modal is used for serverless deployment"]
  - PyGitHub: ["https://pygithub.readthedocs.io/en/latest/", "PyGitHub is used for interacting with GitHub"]

This setting contains documentation links that Sweep is able to search through. This is helpful for packages with syntax that has changed or newer packages.

Important: Please contact us if you would like to add a documentation link so we can add it to our database.

sandbox

sandbox:
  install:
    - apt install python3.11 -y
    - pip install poetry
    - poetry env use python3.11
    - poetry install
  check:
    - poetry run pylint --errors-only {file_path}

Sandbox executes commands in a sandboxed environment to validate code changes after every edit to guarantee pristine code. For more details, see the Sandbox page.

rules

rules:
 - There should not be commented out code.
 - Update UPDATES_MESSAGE section in sweepai/config/client.py if there is a major new feature.
 - Update docs/pages/usage/config.mdx for changes that affect sweep.yaml.
 - Add appropriate documentation when large new features are released. Make sure all envvars are documented in sweepai/config/server.py
 - Make sure all error logs use traceback and any unnecessary info logs are deleted.

This setting contains a list of rules that Sweep will check for. If any of these rules are broken in a new commit, Sweep will create an pull request to fix the broken rule.


Our Configuration File

This file is available here (opens in a new tab). We have pasted this file below for your convenience.

gha_enabled: True
branch: main
blocked_dirs: [".github/"]
draft: False
description: "sweepai/sweep is a python 3.10 project. The main api endpoints are in sweepai/api.py. Write code that adheres to PEP8."
docs:
  - Modal: https://modal.com/docs/reference
  - PyGitHub: https://pygithub.readthedocs.io/en/latest/
 
sandbox:
  install:
    - apt install python3.11 -y
    - pip install poetry
    - poetry env use python3.11
    - poetry install
  check:
    - poetry run pylint --errors-only {file_path}
 
rules:
 - There should not be commented out code.
 - Update UPDATES_MESSAGE section in sweepai/config/client.py if there is a major new feature.
 - Update docs/pages/usage/config.mdx for changes that affect sweep.yaml.
 - Add appropriate documentation when large new features are released. Make sure all envvars are documented in sweepai/config/server.py
 - Make sure all error logs use traceback and any unnecessary info logs are deleted.