Skip to content

Commit 375ca0d

Browse files
committed
fixup! feat: add docstring prompt
1 parent 65a985c commit 375ca0d

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

src/git_draft/bots/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@
1919

2020

2121
def load_bot(config: BotConfig) -> Bot:
22+
"""Load and return a Bot instance using the provided configuration.
23+
24+
If a pythonpath is specified in the config and not already present in
25+
sys.path, it is added. The function expects the config.factory in the
26+
format 'module:symbol' or 'symbol'. If only 'symbol' is provided, the
27+
current module is used.
28+
29+
Args:
30+
config: BotConfig object containing bot configuration details.
31+
32+
Raises:
33+
NotImplementedError: If the specified factory cannot be found.
34+
"""
2235
if config.pythonpath and config.pythonpath not in sys.path:
2336
sys.path.insert(0, config.pythonpath)
2437

@@ -39,6 +52,14 @@ def load_bot(config: BotConfig) -> Bot:
3952

4053

4154
def openai_bot(**kwargs) -> Bot:
55+
"""Instantiate and return an OpenAIBot with provided keyword arguments.
56+
57+
This function imports the OpenAIBot class from the openai module and
58+
returns an instance configured with the provided arguments.
59+
60+
Args:
61+
**kwargs: Arbitrary keyword arguments used to configure the bot.
62+
"""
4263
from .openai import OpenAIBot
4364

4465
return OpenAIBot(**kwargs)

src/git_draft/prompts/add-docstrings.jinja

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,3 @@ class Renderer:
2424

2525
...
2626
```
27-
28-
Use tabs for indentation and do not go over 79 characters.

src/git_draft/prompts/add-test.jinja

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,10 @@ tests. For example, if the surrounding code uses fixtures, do so as well.
77

88
Do not stop until you have added at least one test. You should add separate
99
tests to cover the normal execution path, and to cover any exceptional cases.
10+
11+
For reference, here is the list of all currently available files in the
12+
repository:
13+
14+
{% for path in repo.file_paths %}
15+
* {{ path }}
16+
{% endfor %}

0 commit comments

Comments
 (0)