Repository navigation
Enable Ruff G004 and migrate logging calls to lazy formatting - #255
Merged
Merged
Conversation
Closed
Copilot
AI
changed the title
[WIP] Fix linter error G004 and update suppression list
Enable Ruff G004 and migrate logging calls to lazy formatting
Jun 1, 2026
p-
approved these changes
Jun 1, 2026
kevinbackhouse
marked this pull request as ready for review
June 1, 2026 14:59
kevinbackhouse
requested review from
JarLob,
Kwstubbs,
anticomputer and
sylwia-budzynska
as code owners
June 1, 2026 14:59
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables Ruff rule G004 (logging f-strings) by removing it from the Ruff ignore list and updates logging calls across the codebase to use lazy formatting (logger.info("...", arg)) to keep logging best practices enforced without eager string interpolation.
Changes:
- Removed
G004fromtool.ruff.lint.ignoreinpyproject.toml. - Migrated multiple
logging.*(f"...")call sites to lazy%-style formatting across runtime modules.
Show a summary per file
| File | Description |
|---|---|
src/seclab_taskflow_agent/shell_utils.py |
Switch logging.info from f-string to lazy formatting for shell execution logging. |
src/seclab_taskflow_agent/session.py |
Switch session checkpoint/corrupt-file logging to lazy formatting. |
src/seclab_taskflow_agent/runner.py |
Switch several error/debug/exception logs to lazy formatting in prompt building and task execution. |
src/seclab_taskflow_agent/prompt_parser.py |
Switch prompt parsing error logs to lazy formatting. |
src/seclab_taskflow_agent/mcp_utils.py |
Switch MCP toolbox initialization/debug logs to lazy formatting. |
src/seclab_taskflow_agent/mcp_servers/codeql/client.py |
Switch CodeQL YAML parsing error log to lazy formatting. |
src/seclab_taskflow_agent/mcp_lifecycle.py |
Switch MCP lifecycle logs (connect/cleanup/stdout/stderr) to lazy formatting. |
src/seclab_taskflow_agent/agent.py |
Switch agent/task hook logs to lazy formatting. |
src/seclab_taskflow_agent/_stream.py |
Switch rate-limit backoff logging to lazy formatting. |
pyproject.toml |
Stop ignoring Ruff G004 to enforce logging best practices repo-wide. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 10/10 changed files
- Comments generated: 1
Comment on lines
708
to
712
| for result in task_results: | ||
| if not isinstance(result, bool): | ||
| logging.error(f"Caught exception in Gather: {result}", exc_info=result) | ||
| logging.error("Caught exception in Gather: %s", result, exc_info=result) | ||
| result = False | ||
| complete = result and complete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses issue G004 by removing the
G004suppression from Ruff configuration and updating existing logging f-strings to Ruff-compliant lazy formatting. The goal is to enforceloggingbest practices without changing runtime behavior.Lint policy update
G004fromtool.ruff.lint.ignoreinpyproject.toml, so logging f-strings are now enforced repository-wide.Logging call remediation
_stream.py,agent.py,mcp_lifecycle.py,mcp_utils.py,prompt_parser.py,runner.py,session.py,shell_utils.py, andmcp_servers/codeql/client.py).Representative change