Skip to content

Commit 38a7995

Browse files
committed
refactor: drop three orphaned private symbols
Dead code surfaced by an unused-symbol sweep across `packages/`: - `_BRANCHES` (repl/_indent.py): a frozenset that was only there to document which Robot keywords (`ELSE`, `ELSE IF`, `EXCEPT`, `FINALLY`) the indent counter ignores. Replaced with a short inline comment — same self-documenting effect, no orphan symbol. - `_split_comma` (analyze/code/cli.py): a click callback added alongside the `--xm` / `--xe` exit-code-mask options, then superseded by `_parse_exit_code_mask` and never wired up. - `_cancel_all_running_tasks` (core/concurrent.py): originally the public `cancel_running_callables`; the FutureEx → Task rename privatised it but no caller followed.
1 parent a7ef8bc commit 38a7995

3 files changed

Lines changed: 4 additions & 28 deletions

File tree

packages/analyze/src/robotcode/analyze/code/cli.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,6 @@ def _parse_exit_code_mask(ctx: click.Context, param: click.Option, value: Tuple[
138138
raise click.BadParameter(str(e)) from e
139139

140140

141-
def _split_comma(ctx: click.Context, param: click.Option, value: Optional[List[str]]) -> List[str]:
142-
if value is None:
143-
return []
144-
result: List[str] = []
145-
for item in value:
146-
result.extend([x.strip() for x in item.split(",") if x.strip()])
147-
return result
148-
149-
150141
def _validate_load_library_timeout(ctx: click.Context, param: click.Option, value: Optional[int]) -> Optional[int]:
151142
"""Validate --load-library-timeout (>0) or pass through None."""
152143
if value is None:

packages/core/src/robotcode/core/concurrent.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
Dict,
1111
Generic,
1212
Iterator,
13-
List,
1413
Optional,
1514
Protocol,
1615
Tuple,
@@ -255,15 +254,3 @@ def run_as_debugpy_hidden_task(callable: Callable[_P, _TResult], *args: _P.args,
255254
thread.start()
256255

257256
return future
258-
259-
260-
def _cancel_all_running_tasks(timeout: Optional[float] = None) -> None:
261-
threads: List[threading.Thread] = []
262-
with _running_tasks_lock:
263-
for future, thread in _running_tasks.items():
264-
if not future.cancelation_requested:
265-
future.cancel()
266-
threads.append(thread)
267-
for thread in threads:
268-
if thread is not threading.current_thread():
269-
thread.join(timeout=timeout)

packages/repl/src/robotcode/repl/_indent.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@
2929
# Closer — pops one level of indent.
3030
_CLOSERS = frozenset({"END"})
3131

32-
# Branch markers stay at the *current* depth — they don't open or
33-
# close a block, but they live inside one. Tracking them isn't
34-
# strictly necessary for the indent counter (they're net-zero), but
35-
# we keep the constant for clarity and to make it obvious why the
36-
# counter doesn't touch them.
37-
_BRANCHES = frozenset({"ELSE", "ELSE IF", "EXCEPT", "FINALLY"})
32+
# Branch markers (`ELSE`, `ELSE IF`, `EXCEPT`, `FINALLY`) are net-zero
33+
# for the depth counter — they live inside an open block but neither
34+
# open nor close one. The counter ignores them by default; no
35+
# enumeration needed.
3836

3937
_DEFAULT_WIDTH = 4
4038

0 commit comments

Comments
 (0)