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.

  • Field Details

    • promptBundle

      private final ResourceBundle promptBundle
      Resource bundle containing prompt templates for reviewed files.
  • Constructor Details

    • PythonReviewer

      public PythonReviewer()
  • Method Details

    • getSupportedFileExtensions

      public String[] getSupportedFileExtensions()
      Description copied from interface: Reviewer
      Returns the file extensions (without the dot) that this reviewer can process.
      Specified by:
      getSupportedFileExtensions in interface Reviewer
      Returns:
      an array containing "py"
    • perform

      public String perform(File projectDir, File guidancesFile) throws IOException
      Reviews a Python file for line-comment or triple-quoted guidance.
      Specified by:
      perform in interface Reviewer
      Parameters:
      projectDir - the project root used to compute a relative path
      guidancesFile - the Python file to inspect
      Returns:
      a formatted prompt, or null when no non-blank guidance is found
      Throws:
      IOException - if the file cannot be read