Automated Code Correction is a Python-based command-line utility that integrates with OpenAI’s GPT API to detect compilation or runtime errors in your code, generate accurate fixes, and apply patches automatically. It streamlines debugging by providing fast, context-aware corrections for multiple programming languages directly from your terminal.
Automated Code Correction is a Python-based command-line utility that integrates with OpenAI’s GPT API to detect compilation or runtime errors in your code, generate accurate fixes, and apply patches automatically. It streamlines debugging by providing fast, context-aware corrections for multiple programming languages directly from your terminal.
Automated Code Correction is an open‐source Python script that uses GPT to scan your project’s build or execution error logs, extract relevant error messages, and formulate precise code corrections. Simply run the tool against your codebase; it sends errors to ChatGPT, receives corrected code snippets, and applies them back into your source files. It supports languages like Python, JavaScript, Java, and C++, enabling seamless integration into CI pipelines, developer workflows, and educational environments.
Who will use Automated Code Correction?
Software developers
DevOps engineers
QA and testing teams
Programming students
Technical educators
How to use the Automated Code Correction?
Step1: Clone the repository and install dependencies: `git clone ... && pip install -r requirements.txt`
Step2: Set your OpenAI API key: `export OPENAI_API_KEY=your_key`
Step3: Run the CLI against your project directory: `python auto_correct.py --path ./src`
Step4: Review suggested fixes in the generated patch files
Step5: Apply the patches or merge them into your codebase
Platform
mac
windows
linux
Automated Code Correction's Core Features & Benefits
The Core Features
Automatic detection of compile/runtime errors
ChatGPT-powered code correction generation
Multi-language support (Python, JavaScript, Java, C++)
CLI integration for local and CI/CD use
Patch file creation for easy review
The Benefits
Reduces debugging time
Enhances code quality with AI-driven fixes
Integrates seamlessly into existing workflows
Supports multiple languages and frameworks
Open-source and extensible
Automated Code Correction's Main Use Cases & Applications
Debugging large codebases with complex error logs
Automating error fixes in CI/CD pipelines
Assisting students in learning to debug code
Speeding up code review by providing suggested patches
Integrating AI-driven correction into development environments
import os
import time
import logging
import hashlib
import schedule
from datetime import datetime
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from selenium.common.exceptions import StaleElementReferenceException, WebDriverException, TimeoutException, NoSuchElementException
# Configure logging
logging.basicConfig(
filename='whatsapp_unread_media_automation.log',
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
# Directory for downloads
DOWNLOAD_DIR = r"C:\Users\sgurv\OneDrive\Documents\whatsapp_automation\downloads"
os.makedirs(DOWNLOAD_DIR, exist_ok=True)
# Track existing files to avoid re-downloading
existing_files = {}
def safe_click(element, driver, retries=3):
"""Safely click an element with retries to handle stale references."""
for attempt in range(retries):
try:
driver.execute_script("arguments[0].scrollIntoView({block: 'center'});", element)
element.click()
return True
except StaleElementReferenceException:
time.sleep(1)
if attempt == retries - 1:
return False
except Exception as e:
logging.error(f"Error clicking element: {str(e)}")
return False
return False
def download_blob_image(driver, element, filename, max_retries=2):
"""Download an image with a blob URL using JavaScript with retries."""
start_time = time.time()
max_duration = 30 # Maximum 30 seconds per image
for attempt in range(max_retries):
if time.time() - start_time > max_duration:
logging.warning(f"Download timeout exceeded for {filename} after {max_duration} seconds.")
Automated Code Correction's Main Competitors and alternatives?