Class PythonReviewer

java.lang.Object
org.machanism.machai.gw.reviewer.PythonReviewer
All Implemented Interfaces:
Reviewer

public class PythonReviewer extends Object implements Reviewer
Reviewer implementation for Python source files (.py).

Guidance may appear in either single-line comments (#) or in triple-quoted strings that contain the @guidance tag.

  • Constructor Details

    • PythonReviewer

      public PythonReviewer()
  • Method Details

    • getSupportedFileExtensions

      public String[] getSupportedFileExtensions()
      Returns the file extensions supported by this reviewer.
      Specified by:
      getSupportedFileExtensions in interface Reviewer
      Returns:
      an array containing "py"
    • perform

      public String perform(File projectDir, File guidancesFile) throws IOException
      Reviews the provided Python file and, if guidance is present, returns a formatted prompt fragment.
      Specified by:
      perform in interface Reviewer
      Parameters:
      projectDir - the project root directory used to compute a project-relative path for context
      guidancesFile - the Python file to analyze
      Returns:
      a formatted prompt fragment, or null when the file does not contain guidance
      Throws:
      IOException - if an error occurs while reading the file