Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions plain2code.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,6 @@

DEFAULT_TEMPLATE_DIRS = importlib.resources.files("standard_template_library")

MAX_UNITTEST_FIX_ATTEMPTS = 20
MAX_CONFORMANCE_TEST_FIX_ATTEMPTS = 20
MAX_CONFORMANCE_TEST_RUNS = 20
MAX_REFACTORING_ITERATIONS = 5
MAX_UNIT_TEST_RENDER_RETRIES = 2

MAX_ISSUE_LENGTH = 10000 # Characters.

UNRECOVERABLE_ERROR_EXIT_CODES = [69]
TIMEOUT_ERROR_EXIT_CODE = 124


def get_render_range(render_range, plain_source):
render_range = render_range.split(",")
Expand Down
5 changes: 3 additions & 2 deletions tui/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ def on_mount(self) -> None:
"""Initialize default labels on mount."""
self.module_text = "Module: "
self.functionality_text = "Functionality:"

self._refresh_content()

def compose(self):
Expand Down Expand Up @@ -355,7 +356,7 @@ class FRIDProgress(Vertical):
CONFORMANCE_TEST_VALIDATION_TEXT = "Conformance tests"

RENDERING_MODULE_TEXT = "Module: "
RENDERING_FUNCTIONALITY_TEXT = "Functionality:"
RENDERING_FUNCTIONALITY_TEXT = "Functionality "

def __init__(
self,
Expand All @@ -367,7 +368,7 @@ def __init__(
self.unittests_script = unittests_script
self.conformance_tests_script = conformance_tests_script

def update_fr_text(self, text: str) -> None:
def update_functionality_text(self, text: str) -> None:
try:
# Update the rendering info box instead
info_box = self.query_one(RenderingInfoBox)
Expand Down
15 changes: 13 additions & 2 deletions tui/state_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ def __init__(self, tui, unittests_script: Optional[str], conformance_tests_scrip
def handle(self, _: list[str], snapshot: RenderContextSnapshot, _previous_state_segments: list[str]) -> None:
"""Handle READY_FOR_FRID_IMPLEMENTATION state."""
# Update FRID text
rendering_functionality_text = f"{tui_components.FRIDProgress.RENDERING_FUNCTIONALITY_TEXT} {snapshot.frid_context.functional_requirement_text}"
get_frid_progress(self.tui).update_fr_text(rendering_functionality_text)

rendering_functionality_text = f"{tui_components.FRIDProgress.RENDERING_FUNCTIONALITY_TEXT}{snapshot.frid_context.frid}: {snapshot.frid_context.functional_requirement_text}"
get_frid_progress(self.tui).update_functionality_text(rendering_functionality_text)

# Set progress states
update_progress_item_status(self.tui, TUIComponents.FRID_PROGRESS_RENDER_FR.value, ProgressItem.PROCESSING)
Expand Down Expand Up @@ -216,11 +217,21 @@ def handle(self, segments: list[str], snapshot: RenderContextSnapshot, previous_
)
elif segments[2] == States.CONFORMANCE_TEST_ENV_PREPARED.value:
running_text = f"Running conformance tests for functional requirement {snapshot.conformance_tests_running_context.current_testing_frid}"
if snapshot.conformance_tests_running_context.current_testing_module_name != snapshot.module_name:
running_text += (
f" of module {snapshot.conformance_tests_running_context.current_testing_module_name}"
)

update_progress_item_substates(
self.tui, TUIComponents.FRID_PROGRESS_CONFORMANCE_TEST.value, [Substate(running_text)]
)
elif segments[2] == States.CONFORMANCE_TEST_FAILED.value:
fixing_text = f"Fixing conformance tests for functional requirement {snapshot.conformance_tests_running_context.current_testing_frid}"
if snapshot.conformance_tests_running_context.current_testing_module_name != snapshot.module_name:
fixing_text += (
f" of module {snapshot.conformance_tests_running_context.current_testing_module_name}"
)

update_progress_item_substates(
self.tui, TUIComponents.FRID_PROGRESS_CONFORMANCE_TEST.value, [Substate(fixing_text)]
)
Expand Down
Loading