feat: guidelines

This commit is contained in:
u80864958
2026-02-13 18:20:57 +01:00
parent 2e12c39786
commit 75ef8da1a4
9 changed files with 242 additions and 69 deletions

View File

@@ -45,10 +45,11 @@ type ReviewConfig struct {
MaxChunkSize int `help:"Maximum diff chunk size in bytes" default:"60000"`
Guidelines []string `help:"Project guidelines to prepend" sep:","`
DisableComments bool `help:"Disable posting comments (dry run)"`
SanityCheck bool `help:"Run sanitycheck LLM prompts per comment" default:"true"`
}
type Config struct {
LogLevel string `help:"Log verbosity: debug, info, warn, error"`
LogLevel string `help:"Log verbosity: debug, info, warn, error" default:"info"`
// Embedding ReviewConfig with a prefix changes flag names to `--review-…`.
// Existing configuration files using the old flag names will need to be updated.
@@ -152,6 +153,7 @@ func main() {
}
pierreService := pierre.New(ai, git, cfg.Review.MaxChunkSize, cfg.Review.Guidelines, cfg.Review.DisableComments)
pierreService.SetSanityCheck(cfg.Review.SanityCheck)
if err := pierreService.MakeReview(context.Background(), cfg.Repo.Owner, cfg.Repo.Repo, cfg.Repo.PRID); err != nil {
log.Fatalf("Error during review: %v", err)
}