git_iris/types/
pr.rs

1//! Pull request types and formatting
2//!
3//! This module provides markdown-based PR output that lets the LLM drive
4//! the structure while we beautify it for terminal display.
5
6use crate::types::review::render_markdown_for_terminal;
7use schemars::JsonSchema;
8use serde::{Deserialize, Serialize};
9
10/// Markdown-based pull request that lets the LLM determine structure
11#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)]
12pub struct MarkdownPullRequest {
13    /// The full markdown content of the PR description
14    pub content: String,
15}
16
17impl MarkdownPullRequest {
18    /// Render the markdown content with terminal styling
19    pub fn format(&self) -> String {
20        render_markdown_for_terminal(&self.content)
21    }
22
23    /// Get the raw markdown content (for GitHub/GitLab, etc.)
24    pub fn raw_content(&self) -> &str {
25        &self.content
26    }
27}