App, lib, cmds: Remove unreachable code

Remove dead code paths detected by the new warn_unreachable mypy
rule. These include:

- Removed always-false isinstance checks (ssh/util.py, templates.py)
- Removed unreachable return statements after raise (FileContext.py)
- Removed unreachable None checks for typed variables (Result.py,
  ExecContext.py, CmdGetAuthInfo.py)
- Simplified __uri function by removing impossible None check
  (CopyContext.py)
- Changed assert False to explicit error (Cmd.py)
- Removed unreachable None case from match (App.py)
- Removed redundant outer case _: pass (pkg_relations.py)
- Restructured stdin write to avoid unreachable warning (AsyncSSH.py)

Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-07-22 22:42:18 +02:00
commit c16e054aaa
11 changed files with 7 additions and 25 deletions

View file

@ -90,8 +90,6 @@ class CmdGetAuthInfo(Cmd): # export
for key, val in result.items():
if not getattr(args, key, None):
continue
if val is None:
continue
if args.only_values:
print(val)
continue

View file

@ -161,8 +161,6 @@ def pkg_relations(
expanded_dep[1] = '>>'
case _:
pass
case _:
pass
dep_str = ' '.join(expanded_dep)
if quote:
dep_str = '"' + dep_str + '"'

View file

@ -66,10 +66,7 @@ def merge_values(*values: RenderValues) -> ListDict:
rhs_dict = render_values_to_list_dict(rhs)
for key, val in rhs_dict.items():
entry = ret.setdefault(key, [])
if isinstance(val, list):
entry += val
else:
entry.append(val)
entry += val
return ret
def format_list_dict(