validate_and_truncate_diff

Function validate_and_truncate_diff 

Source
pub fn validate_and_truncate_diff(diff: String) -> (String, bool)
Expand description

Validate and optionally truncate a diff for LLM consumption (for reviewers).

This function checks if a diff is too large for effective LLM processing and truncates it for reviewer use. For commit messages, use chunk instead.

§Arguments

  • diff - The git diff to validate

§Returns

Returns a tuple containing:

  • The validated (and possibly truncated) diff
  • A boolean indicating whether the diff was truncated