
Chris CoutinhoandClaude Opus 4.7
665cb9b1eb
refactor: convert f-string logging to lazy %-style format (G004)
Sweep all 1676 G004 violations across 112 files, converting
`logger.<level>(f"…{x}…")` to `logger.<level>("…%s…", x)`.
Why: ruff rule G004 was added to pyproject.toml to enforce lazy
%-style logging — defers formatting until the log level is enabled
and lets structured log tooling match the unformatted template.
Conversion preserves rendered output byte-for-byte:
- `{x}` → `%s` + `x`
- `{x!r}` / `{x!s}` / `{x!a}` → `%r` / `%s` / `%a`
- Format specs (`{x:.2f}`, `{x:>10}`) → `%s` + `format(x, 'spec')`
(printf-style specs aren't 1:1 with Python format specs, so we
delegate to `format()` to keep identical output)
- Literal `%` → `%%`
- Concatenated f-strings (`f"a {x} " "b"`) flattened
- Trailing kwargs (`exc_info=True`) preserved
Verified:
- `uv run ruff check --select G004` → 0 violations
- `uv run ty check -- nextcloud_mcp_server` → passes
- `uv run pytest tests/unit/` → 1010 passed
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 01:12:17 +02:00
..
2025-11-11 20:35:08 +01:00
2026-05-13 01:12:17 +02:00
2025-10-17 04:30:03 +02:00
2026-05-13 01:12:17 +02:00
2026-05-13 01:12:17 +02:00
2025-11-23 00:33:32 +01:00
2026-05-13 01:12:17 +02:00
2026-04-01 16:05:14 +02:00
2026-05-12 22:57:35 +02:00
2025-10-24 01:04:30 +02:00
2026-05-13 01:12:17 +02:00
2026-04-07 23:26:46 +02:00
2026-05-13 01:12:17 +02:00