Buckets:

download
raw
2.34 kB
#!/usr/bin/env python3
"""
Perfect Auto-Linting Agent - NEVER SLEEPS!
Forces immediate markdown fixing without any delays.
"""
import os
import sys
import time
import subprocess
from pathlib import Path
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class PerfectMarkdownHandler(FileSystemEventHandler):
"""Immediately fixes ANY markdown file that changes"""
def __init__(self):
self.root_dir = Path.cwd()
print(f"๐Ÿ”ฅ PERFECT AGENT ACTIVATED - Watching: {self.root_dir}")
def on_modified(self, event):
if event.is_directory:
return
file_path = Path(event.src_path)
# Only process markdown files
if file_path.suffix.lower() != ".md":
return
# Skip ignored paths
rel_path = str(file_path.relative_to(self.root_dir))
if any(skip in rel_path for skip in ["node_modules", ".git", ".tmp", "__pycache__"]):
return
print(f"๐Ÿ”ง MARKDOWN CHANGED: {file_path}")
# FORCE IMMEDIATE FIX
try:
result = subprocess.run(
[sys.executable, "tools/auto_lint_fixer.py", str(file_path)],
capture_output=True,
text=True,
timeout=30,
)
if result.returncode == 0:
print(f"โœ… FIXED: {file_path}")
else:
print(f"โš ๏ธ Issue with {file_path}: {result.stderr}")
except Exception as e:
print(f"โŒ Error fixing {file_path}: {e}")
def on_created(self, event):
# Also handle newly created markdown files
self.on_modified(event)
def main():
"""Start the perfect agent that NEVER sleeps"""
print("๐Ÿš€ Starting PERFECT Auto-Linting Agent...")
print("๐ŸŽฏ This agent NEVER sleeps and fixes markdown IMMEDIATELY!")
print("๐Ÿ“ Monitoring ALL markdown files")
print("โšก Press Ctrl+C to stop")
event_handler = PerfectMarkdownHandler()
observer = Observer()
observer.schedule(event_handler, ".", recursive=True)
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
print("\n๐Ÿ›‘ Stopping Perfect Agent...")
observer.stop()
observer.join()
if __name__ == "__main__":
main()

Xet Storage Details

Size:
2.34 kB
ยท
Xet hash:
9b8192701ef30fe0d9e47f3c5ce4c0b6e666e2c51e60c6fa4607d27571e4ed63

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.