Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: local
hooks:
- id: poetry-lock
name: poetry lock
entry: poetry lock
language: system
pass_filenames: false
files: ^(.*/)?(poetry\.lock|pyproject\.toml)$
- id: poetry-fix
name: poetry fix
entry: poetry run poe fix
language: system
require_serial: true
types_or: [python, pyi, jupyter]
207 changes: 30 additions & 177 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 18 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,29 @@ packages = [{include="git_draft", from="src"}]
python = ">=3.12,<4"

[tool.poetry.group.dev.dependencies]
black = "^25.1.0"
coverage = "^7.4.4"
flake8 = "^7.0.0"
flake8-pyproject = "^1.2.3"
isort = "^6.0.1"
mypy = "^1.2.0"
mypy = "^1.2.1"
poethepoet = "^0.25.0"
pytest = "^7.1.2"
pytest = "^7.1.0"
ruff = "^0.11.0"

# Poe

[tool.poe.tasks.fix]
help = "format source code"
sequence = [
{cmd="isort ${args}"},
{cmd="black ${args}"},
{cmd="ruff format ${args}"},
{cmd="ruff check --fix ${args}"},
]
args = [
{name="args", help="target folders", positional=true, multiple=true, default="src tests"},
]

[tool.poe.tasks.lint]
help = "lint source code"
help = "lint configuration and source code"
sequence = [
{cmd="isort --check ${args}"},
{cmd="black --check --quiet ${args}"},
{cmd="flake8 ${args}"},
{cmd="poetry check"},
{cmd="ruff check ${args}"},
{cmd="mypy ${args}"},
]
args = [
Expand Down Expand Up @@ -92,16 +88,18 @@ relative_files = true
include = ["src/**/*.py"]
show_missing = true

[tool.flake8]
ignore = ["E203", "E501", "E704", "W503"]

[tool.isort]
profile = "black"
force_sort_within_sections = true
lines_after_imports = 2

[tool.mypy]
disable_error_code = "import-untyped"

[tool.pytest.ini_options]
log_level = "DEBUG"

[tool.ruff]
line-length = 79

[tool.ruff.lint]
select = ["E", "F", "I"]

[tool.ruff.lint.isort]
force-sort-within-sections = true
lines-after-imports = 2
1 change: 0 additions & 1 deletion src/git_draft/bots/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ def _on_list_files(self, paths: Sequence[PurePosixPath]) -> str:


class _ThreadsBot(Bot):

def __init__(self, client: openai.OpenAI, assistant_id: str) -> None:
self._client = client
self._assistant_id = assistant_id
Expand Down