Class Reviewers

java.lang.Object
org.approvej.review.Reviewers

@NullMarked public class Reviewers extends Object
Collection of static methods to create Reviewer instances.
  • Method Details

    • none

      public static Reviewer none()
      A Reviewer that does nothing and never triggers a reapproval.
      Returns:
      a Reviewer that does nothing
    • script

      public static Reviewer script(String script)
      A Reviewer that executes the given script.
      Parameters:
      script - the script to be executed with placeholders "{receivedFile}" and "{approvedFile}"
      Returns:
      the new ScriptReviewer
    • ai

      public static Reviewer ai(String command)
      A Reviewer that calls an AI CLI tool to review the difference between the received and approved files.

      The AI CLI receives a prompt on stdin. For text files, this prompt includes a unified diff. For image files, the prompt mentions the relevant file paths (for example, a diff image path when available). File paths are only passed as CLI arguments if the command string includes placeholders that are expanded by the reviewer. If the AI responds with "YES", the received file is automatically approved.

      Parameters:
      command - the AI CLI command to execute (e.g., "claude", "gemini")
      Returns:
      the new AiReviewer
    • automatic

      public static Reviewer automatic()
      A Reviewer that accepts any given received value, ignoring the previously approved value.

      This may be a good idea when you have a lot of tests with changed results, and you simply want to update them all at once. You probably want to review the changed approved files before committing them to version control!

      Returns:
      a Reviewer that accepts any received value automatically