Initial attempt at git module
This commit is contained in:
parent
645d329321
commit
c4c696df5a
6 changed files with 269 additions and 6 deletions
|
@ -2,6 +2,8 @@ from dataclasses import dataclass
|
|||
from pathlib import Path
|
||||
from typing import List
|
||||
|
||||
from .cli import normalize_server_url
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class OllamaConfig:
|
||||
|
@ -19,6 +21,7 @@ class ReviewConfig:
|
|||
|
||||
paths: List[Path]
|
||||
ollama: OllamaConfig
|
||||
base_branch: str
|
||||
|
||||
|
||||
def create_ollama_config(
|
||||
|
@ -34,14 +37,19 @@ def create_ollama_config(
|
|||
|
||||
|
||||
def create_review_config(
|
||||
paths: List[Path], ollama_config: OllamaConfig
|
||||
paths: List[Path], ollama_config: OllamaConfig, base_branch: str
|
||||
) -> ReviewConfig:
|
||||
"""Create complete ReviewConfig from validated components."""
|
||||
return ReviewConfig(paths=paths, ollama=ollama_config)
|
||||
return ReviewConfig(paths=paths, ollama=ollama_config, base_branch=base_branch)
|
||||
|
||||
|
||||
def create_config_from_vars(
|
||||
paths: List[Path], model: str, server_url: str, timeout: int, max_retries: int
|
||||
paths: List[Path],
|
||||
model: str,
|
||||
server_url: str,
|
||||
timeout: int,
|
||||
max_retries: int,
|
||||
base_branch: str,
|
||||
):
|
||||
ollama_config = OllamaConfig(
|
||||
model=model,
|
||||
|
@ -50,4 +58,4 @@ def create_config_from_vars(
|
|||
max_retries=max_retries,
|
||||
)
|
||||
|
||||
return create_review_config(paths, ollama_config)
|
||||
return create_review_config(paths, ollama_config, base_branch)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue