fix(proxy): use click.echo for the ASCII fallback so no T201 suppression is added

The lint gate counts RUF100 across the tree and this branch took the total to
101 against a limit of 100. The added line carried a T201 suppression copied
from the line above it, and the two ruff configs disagree about whether that
suppression is needed: ruff.toml enables T20 so a bare print needs it, while
ruff-strict.toml does not enable T20 and so counts it as dead.

Reaching that handler means the import succeeded and only the encode failed,
so click is already bound and is the channel the banner itself went out on.
Using it sidesteps the disagreement rather than picking a side. Behaviour is
unchanged: a cp1252 stdout still gets the plain ASCII name and a utf-8 one
still gets the full banner. The pre-existing suppression on the line above is
left alone, which puts the total back at 100.
This commit is contained in:
arthi-arumugam-git 2026-08-08 14:03:39 +05:30
parent 3c9e68661e
commit cc62676e25

View file

@ -18,4 +18,9 @@ def show_banner():
except ImportError:
print("\n") # noqa: T201
except UnicodeEncodeError:
print("\n LiteLLM\n") # noqa: T201
# Reaching here means the import succeeded and only the encode failed, so `click` is
# bound and is the same channel the banner just went out on. Using it rather than
# `print` keeps the line free of a T201 suppression, which the two ruff configs
# disagree about: ruff.toml enables T20 and needs one, ruff-strict.toml does not
# enable it and counts one as dead under RUF100.
click.echo("\n LiteLLM\n")