Skip to content

cometjc/opencode-py-indent-guard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCode Python Indent Guard

An OpenCode plugin that acts as a safety net for Python file edits. It automatically detects if an edit introduces syntax or indentation errors, and if so, safely reverts the file to its previous state and reports the error inline.

Features

  • Automatic Detection: Hooks into the edit tool to validate Python syntax immediately after changes.
  • Auto-Revert: If python3 -m py_compile fails, the file is instantly reverted to prevent broken code from persisting.
  • TUI/LSP Integration: Injects error status directly into the OpenCode diagnostics view, so you see "REVERTED" status alongside standard linting errors.
  • Safe: Does not corrupt the Agent TUI with raw stderr output.

Installation

This plugin is intended for use with the OpenCode agent.

npm install @cometjc/opencode-py-indent-guard

Usage

Register the plugin in your OpenCode configuration.

import { PythonIndentGuard } from "@cometjc/opencode-py-indent-guard";

// In your plugin registration
register(PythonIndentGuard);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors