Fix T201: replace print() with logging; remove global suppression#253
Draft
Copilot wants to merge 2 commits into
Draft
Fix T201: replace print() with logging; remove global suppression#253Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Open
Copilot
AI
changed the title
[WIP] Fix linter error T201 and update suppression list
Fix T201: replace print() with logging; remove global suppression
Jun 1, 2026
p-
requested changes
Jun 1, 2026
|
|
||
| WAIT_INTERVAL = 0.1 | ||
|
|
||
| logger = logging.getLogger(__name__) |
Contributor
There was a problem hiding this comment.
Logging should be configured here (similar as to our other MCP servers, but with a different file name)
e.g.
https://github.com/GitHubSecurityLab/seclab-taskflows/blob/1eafe13b91b5fa717f96625b24badac9cb4ffe48/src/seclab_taskflows/mcp_servers/gh_file_viewer.py#L21
| if log: | ||
| render_logger.info(data) | ||
| print(data, end="", flush=True) | ||
| sys.stdout.write(data) |
Contributor
There was a problem hiding this comment.
I think a single line linter suppression is better here than using sys.stdout
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.
T201(printfound) was globally suppressed inpyproject.tomlrather than properly addressed. This removes the blanket suppression and fixes all violations.Changes
pyproject.toml: removeT201from globalignore; add per-fileT201ignore forrelease_tools/*andscripts/*whereprint()is legitimate CLI user outputmcp_servers/codeql/client.py: addlogger = logging.getLogger(__name__); replace allprint()calls withlogger.debug(),logger.info(), orlogger.error()as appropriaterender_utils.py: replaceprint(data, end="", flush=True)withsys.stdout.write(data)+sys.stdout.flush()to preserve streaming terminal output semantics