forked from sweepai/sweep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sweep.yaml
39 lines (36 loc) · 2.62 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
gha_enabled: True
branch: main
blocked_dirs: ["tests"]
draft: False
description: "sweepai/sweep is a python 3.10 project. The main api endpoints are in sweepai/api.py. All imports should be global (like `import sweepai.utils.github_utils`). Write unit tests in the same directory as their corresponding code, i.e. sweepai/api_test.py tests sweepai/api.py. We use pytest for tests. Never use wildcard imports. Use list and tuple for typing instead of typing.List and typing.Tuple."
# These are the docs that we index for Sweep.
# We scrape these docs once a day and store them in our database.
# You can use it by adding the key to your GitHub issue.
# Example: Use PyGitHub to get the number of files in a repo.
# The title should be restrictive so it only shows up when the user wants it.
# "React JS" is good, "React" is not.
# The url should be the root of the docs, not a specific page. We will scrape all pages under this root.
# "https://react.dev/" is good, "https://react.dev/docs/getting-started" is not.
# Write a natural language description of what the package is and how it's used to help Sweep.
docs:
github: ["https://pygithub.readthedocs.io/en/stable", "We use github to perform actions with Sweep."]
deeplake: ["https://docs.deeplake.ai/en/latest", "We use deeplake as our vector database."]
sandbox:
install:
- pre-commit install
- pre-commit run --file sweepai/api.py || exit 0
- pip install poetry
- poetry install
- poetry run pip install torch --index-url https://download.pytorch.org/whl/cpu
check:
- git add . && pre-commit run --files {file_path} || exit 0
- 'if [[ "{file_path}" == *.py ]]; then poetry run pylint --errors-only {file_path}; else exit 0; fi'
- 'if [[ "{file_path}" == *.py ]]; then PYTHONPATH=. poetry run python {file_path}; else exit 0; fi'
rules:
- "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 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, sweepai/api_test.py tests sweepai/api.py. Use unittest and unittest.mock as required."
- "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')`."