-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsweep.yaml
48 lines (40 loc) · 3.76 KB
/
sweep.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 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 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 a pull request to fix the broken rule.
rules:
- "There should not be large chunks of code that are just commented out. Docstrings and explanations in code are acceptable."
- "We should use loguru for error logging. If the log is inside an exception, use loguru.exception to add tracebacks. Use f-strings for string formatting in logger calls."
- "There should be no instances of `import pdb; pdb.set_trace()` in production code."
- "There should be no debug log or print statements in production code."
- "All functions should have parameters and output annotated with type hints. Use list, tuple, and dict instead of typing.List, typing.Tuple and typing.dict."
- "Leftover TODOs in the code should be handled."
- "All new business logic should have corresponding unit tests in the same directory. For example, tests/utils/string_test.py tests aicord/utils/string.py. We use pytest for tests."
- "Any clearly inefficient or repeated code should be optimized or refactored."
- "Remove any comments before code that are obvious. For example `# this prints hello world; print('hello world')`."
- "Avoid duplicating code. Refactor and update duplicate code to improve maintainability."
- "Use consistent and descriptive commit messages that accurately reflect the changes made. Use gitmoji for commit messages."
- "Handle exceptions gracefully and provide appropriate error handling and logging."
# 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: 'master'
# 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.
description: 'Aicord is a Python 3.10 project. The main bot functionality is in aicord/discord/cogs modules. Each cog represents a category of commands. All imports should be global (like `import sweepai.utils.github_utils`). Never use wildcard imports. Write unit tests in the same directory as their corresponding code, i.e., tests/utils/string_test.py tests aicord/utils/string.py. We use pytest for tests.'
# 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.
blocked_dirs: []
# 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.
docs:
- LangChain: ["https://python.langchain.com/docs/get_started/introduction", "We use LangChain for LLM"]
- Pycord: ["https://docs.pycord.dev/en/stable/", "We use Pycord for Discord API and bot commands"]
- gitmoji: ["https://gitmoji.dev/specification", "We use gitmoji for commit messages"]
- pytest: ["https://docs.pytest.org/en/7.4.x/", "We use pytest for unit tests"]
- railway.app: ["https://help.railway.app/", "We use the railway.app for deployment"]
# 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 --print-failures {file_path}