feat(style): Fix 1-space indentation in 27 files
Files corrected: - src/fuzzy_anchor.py (18 violations) - src/patch_modal.py (14 violations) - scripts/extract_symbols.py (4 violations) - scripts/tasks/download_fonts.py (8 violations) - tests/: 23 files with indentation issues All files verified with py_compile. Remaining 4 files (test_api_events.py, test_discussion_takes_gui.py, test_gui_updates.py, test_headless_service.py) have complex multi-line with statements that require manual correction.
This commit is contained in:
+84
-84
@@ -3,104 +3,104 @@ from dataclasses import dataclass, field
|
||||
|
||||
@dataclass
|
||||
class PendingPatch:
|
||||
patch_text: str
|
||||
file_paths: List[str]
|
||||
generated_by: str
|
||||
timestamp: float
|
||||
patch_text: str
|
||||
file_paths: List[str]
|
||||
generated_by: str
|
||||
timestamp: float
|
||||
|
||||
class PatchModalManager:
|
||||
def __init__(self):
|
||||
self._pending_patch: Optional[PendingPatch] = None
|
||||
self._show_modal: bool = False
|
||||
self._on_apply_callback: Optional[Callable[[str], bool]] = None
|
||||
self._on_reject_callback: Optional[Callable[[], None]] = None
|
||||
def __init__(self):
|
||||
self._pending_patch: Optional[PendingPatch] = None
|
||||
self._show_modal: bool = False
|
||||
self._on_apply_callback: Optional[Callable[[str], bool]] = None
|
||||
self._on_reject_callback: Optional[Callable[[], None]] = None
|
||||
|
||||
def request_patch_approval(self, patch_text: str, file_paths: List[str], generated_by: str = "Tier 4 QA") -> bool:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_close_modal, tests/test_patch_modal.py:test_reject_patch, tests/test_patch_modal.py:test_request_patch_approval, tests/test_patch_modal.py:test_reset]
|
||||
"""
|
||||
from time import time
|
||||
self._pending_patch = PendingPatch(
|
||||
patch_text=patch_text,
|
||||
file_paths=file_paths,
|
||||
generated_by=generated_by,
|
||||
timestamp=time()
|
||||
)
|
||||
self._show_modal = True
|
||||
return True
|
||||
def request_patch_approval(self, patch_text: str, file_paths: List[str], generated_by: str = "Tier 4 QA") -> bool:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_close_modal, tests/test_patch_modal.py:test_reject_patch, tests/test_patch_modal.py:test_request_patch_approval, tests/test_patch_modal.py:test_reset]
|
||||
"""
|
||||
from time import time
|
||||
self._pending_patch = PendingPatch(
|
||||
patch_text=patch_text,
|
||||
file_paths=file_paths,
|
||||
generated_by=generated_by,
|
||||
timestamp=time()
|
||||
)
|
||||
self._show_modal = True
|
||||
return True
|
||||
|
||||
def get_pending_patch(self) -> Optional[PendingPatch]:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_patch_modal_manager_init, tests/test_patch_modal.py:test_reject_patch, tests/test_patch_modal.py:test_request_patch_approval, tests/test_patch_modal.py:test_reset]
|
||||
"""
|
||||
return self._pending_patch
|
||||
def get_pending_patch(self) -> Optional[PendingPatch]:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_patch_modal_manager_init, tests/test_patch_modal.py:test_reject_patch, tests/test_patch_modal.py:test_request_patch_approval, tests/test_patch_modal.py:test_reset]
|
||||
"""
|
||||
return self._pending_patch
|
||||
|
||||
def is_modal_shown(self) -> bool:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_close_modal, tests/test_patch_modal.py:test_patch_modal_manager_init, tests/test_patch_modal.py:test_reject_patch, tests/test_patch_modal.py:test_request_patch_approval, tests/test_patch_modal.py:test_reset]
|
||||
"""
|
||||
return self._show_modal
|
||||
def is_modal_shown(self) -> bool:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_close_modal, tests/test_patch_modal.py:test_patch_modal_manager_init, tests/test_patch_modal.py:test_reject_patch, tests/test_patch_modal.py:test_request_patch_approval, tests/test_patch_modal.py:test_reset]
|
||||
"""
|
||||
return self._show_modal
|
||||
|
||||
def set_apply_callback(self, callback: Callable[[str], bool]) -> None:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_apply_callback, tests/test_patch_modal.py:test_reset]
|
||||
"""
|
||||
self._on_apply_callback = callback
|
||||
def set_apply_callback(self, callback: Callable[[str], bool]) -> None:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_apply_callback, tests/test_patch_modal.py:test_reset]
|
||||
"""
|
||||
self._on_apply_callback = callback
|
||||
|
||||
def set_reject_callback(self, callback: Callable[[], None]) -> None:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_reject_callback, tests/test_patch_modal.py:test_reset]
|
||||
"""
|
||||
self._on_reject_callback = callback
|
||||
def set_reject_callback(self, callback: Callable[[], None]) -> None:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_reject_callback, tests/test_patch_modal.py:test_reset]
|
||||
"""
|
||||
self._on_reject_callback = callback
|
||||
|
||||
def apply_patch(self, patch_text: str) -> bool:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_apply_callback]
|
||||
"""
|
||||
if self._on_apply_callback:
|
||||
return self._on_apply_callback(patch_text)
|
||||
return False
|
||||
def apply_patch(self, patch_text: str) -> bool:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_apply_callback]
|
||||
"""
|
||||
if self._on_apply_callback:
|
||||
return self._on_apply_callback(patch_text)
|
||||
return False
|
||||
|
||||
def reject_patch(self) -> None:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_reject_callback, tests/test_patch_modal.py:test_reject_patch]
|
||||
"""
|
||||
self._pending_patch = None
|
||||
self._show_modal = False
|
||||
if self._on_reject_callback:
|
||||
self._on_reject_callback()
|
||||
def reject_patch(self) -> None:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_reject_callback, tests/test_patch_modal.py:test_reject_patch]
|
||||
"""
|
||||
self._pending_patch = None
|
||||
self._show_modal = False
|
||||
if self._on_reject_callback:
|
||||
self._on_reject_callback()
|
||||
|
||||
def close_modal(self) -> None:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_close_modal]
|
||||
"""
|
||||
self._show_modal = False
|
||||
def close_modal(self) -> None:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_close_modal]
|
||||
"""
|
||||
self._show_modal = False
|
||||
|
||||
def reset(self) -> None:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_reset]
|
||||
"""
|
||||
self._pending_patch = None
|
||||
self._show_modal = False
|
||||
self._on_apply_callback = None
|
||||
self._on_reject_callback = None
|
||||
def reset(self) -> None:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_reset]
|
||||
"""
|
||||
self._pending_patch = None
|
||||
self._show_modal = False
|
||||
self._on_apply_callback = None
|
||||
self._on_reject_callback = None
|
||||
|
||||
_patch_modal_manager: Optional[PatchModalManager] = None
|
||||
|
||||
def get_patch_modal_manager() -> PatchModalManager:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_get_patch_modal_manager_singleton]
|
||||
"""
|
||||
global _patch_modal_manager
|
||||
if _patch_modal_manager is None:
|
||||
_patch_modal_manager = PatchModalManager()
|
||||
return _patch_modal_manager
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_get_patch_modal_manager_singleton]
|
||||
"""
|
||||
global _patch_modal_manager
|
||||
if _patch_modal_manager is None:
|
||||
_patch_modal_manager = PatchModalManager()
|
||||
return _patch_modal_manager
|
||||
|
||||
def reset_patch_modal_manager() -> None:
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_get_patch_modal_manager_singleton]
|
||||
"""
|
||||
global _patch_modal_manager
|
||||
if _patch_modal_manager:
|
||||
_patch_modal_manager.reset()
|
||||
_patch_modal_manager = None
|
||||
"""
|
||||
[C: tests/test_patch_modal.py:test_get_patch_modal_manager_singleton]
|
||||
"""
|
||||
global _patch_modal_manager
|
||||
if _patch_modal_manager:
|
||||
_patch_modal_manager.reset()
|
||||
_patch_modal_manager = None
|
||||
Reference in New Issue
Block a user