[good-first-issue] v1: convert cache-controller logging to %-format
Follow-up for #5118 after #5125.
#5125 enabled Ruff G004 repo-wide and added temporary per-file-ignores for the files/directories that still build logging messages with f-strings. This issue is one small slice of that cleanup queue.
Claiming: please comment /claim and wait for assignment so we avoid duplicate PRs.
Scope
Convert only the logging f-strings in:
lmcache/v1/cache_controller/controller_manager.py(5 G004 findings)lmcache/v1/cache_controller/executor.py(5 G004 findings)lmcache/v1/cache_controller/worker.py(2 G004 findings)
Counts above were measured on dev at dd5dfca with ruff check --isolated --select G004.
Expected change
- Replace logging f-strings with lazy
%-style logging arguments, for examplelogger.info("loaded %s tokens", num_tokens). - Preserve the rendered log text and behavior.
- Do not change non-logging f-strings or unrelated control flow.
- Remove the matching
G004ignore entry/entries frompyproject.tomlonce the listed paths are clean.
Matching ignore entry/entries:
"lmcache/v1/cache_controller/controller_manager.py" = ["G004"]"lmcache/v1/cache_controller/executor.py" = ["G004"]"lmcache/v1/cache_controller/worker.py" = ["G004"]
For a ** directory ignore, delete the directory entry only when the whole listed directory is clean. If a merge conflict leaves other unmigrated files in that ignored directory, replace the broad ** entry with explicit file-level entries for the leftovers.
Verification
ruff check --isolated --select G004 lmcache/v1/cache_controller/controller_manager.py lmcache/v1/cache_controller/executor.py lmcache/v1/cache_controller/worker.py
ruff check --select G004 lmcache/v1/cache_controller/controller_manager.py lmcache/v1/cache_controller/executor.py lmcache/v1/cache_controller/worker.py pyproject.toml
pre-commit run --all-filesThe first command should report zero findings after the cleanup. The second command verifies the repo config still passes after removing the ignore entry/entries.
Refs #5118 Refs #3372 Refs #5125
Source: LMCache/LMCache