Skip to content

Commit 15ca45c

Browse files
authored
chore: add coverage (#29)
1 parent 2f177c8 commit 15ca45c

File tree

6 files changed

+118
-3
lines changed

6 files changed

+118
-3
lines changed

.github/workflows/test.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,10 @@ jobs:
2121
with:
2222
github-token: ${{ secrets.GITHUB_TOKEN }}
2323
- name: Test
24-
run: poetry run pytest
24+
run: |
25+
poetry run poe test
26+
poetry run coverage xml
27+
- name: Upload coverage report
28+
uses: codecov/codecov-action@v5
29+
with:
30+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
dist/
22
docs/_*
3+
.coverage

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,18 @@
77

88
* Concurrent editing. Continue editing while the assistant runs, without any
99
risks of interference.
10+
11+
12+
## Ideas
13+
14+
* Change prompt CLI inputs to `[PROMPT] [--] [ARGS]`. If `PROMPT` does not
15+
contain any spaces or `ARGS` (or `--`) is present, it will be interpreted as a
16+
template name. Otherwise an inline prompt.
17+
* Only include files that the bot has written in draft commits.
18+
* Add `--generate` timeout option.
19+
* Add `Bot.state_folder` class method, returning a path to a folder specific to
20+
the bot implementation (derived from the class' name) for storing arbitrary
21+
data.
22+
* Add URL and API key to `openai_bot`. Also add a compatibility version which
23+
does not use threads, so that it can be used with tools only. Gemini only
24+
supports the latter.

poetry.lock

Lines changed: 77 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ python = ">=3.12,<4"
3737

3838
[tool.poetry.group.dev.dependencies]
3939
black = "^25.1.0"
40+
coverage = "^7.4.4"
4041
flake8 = "^7.0.0"
4142
flake8-pyproject = "^1.2.3"
4243
mypy = "^1.2.0"
@@ -63,12 +64,28 @@ args = [
6364
{name="args", help="target folders", positional=true, multiple=true, default="src tests"},
6465
]
6566

67+
[tool.poe.tasks.test]
68+
help = "run tests with coverage"
69+
sequence = [
70+
{cmd="coverage run"},
71+
{cmd="coverage report"},
72+
]
73+
6674
# Other tools
6775

6876
[tool.black]
6977
line-length = 79
7078
include = '\.py$'
7179

80+
[tool.coverage.run]
81+
branch = true
82+
command_line = "-m pytest"
83+
relative_files = true
84+
85+
[tool.coverage.report]
86+
include = ["src/**/*.py"]
87+
show_missing = true
88+
7289
[tool.flake8]
7390
ignore = ["E203", "E501", "E704", "W503"]
7491

src/git_draft/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def callback(_option, _opt, _value, parser) -> None:
5757
"-b",
5858
"--bot",
5959
dest="bot",
60-
help="bot key",
60+
help="bot name",
6161
)
6262
parser.add_option(
6363
"-c",

0 commit comments

Comments
 (0)