Fix A004: remove __doc__ import shadowing Python builtin#201
Open
Fix A004: remove __doc__ import shadowing Python builtin#201
__doc__ import shadowing Python builtin#201Conversation
Open
Agent-Logs-Url: https://github.com/GitHubSecurityLab/seclab-taskflow-agent/sessions/f9e769e5-cc89-4855-be88-a0fd9beb0f6e Co-authored-by: kevinbackhouse <4358136+kevinbackhouse@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix linter error A004 and remove from suppression list
Fix A004: remove Apr 2, 2026
__doc__ import shadowing Python builtin
kevinbackhouse
approved these changes
Apr 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Removes an import that triggers Ruff’s A004 (import shadows built-in) in the vendored jsonrpyc package, and tightens repo linting by no longer globally ignoring A004.
Changes:
- Drop
__doc__from thejsonrpyc/__init__.pymetadata import list to avoidA004. - Remove
A004from[tool.ruff.lint].ignoreso future occurrences are flagged.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/init.py | Removes __doc__ import from .__meta__ to stop shadowing and satisfy A004. |
| pyproject.toml | Stops ignoring Ruff A004 at the project level to enforce the rule going forward. |
Comments suppressed due to low confidence (1)
src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/init.py:25
- Removing the
from .__meta__ import __doc__line changesjsonrpyc.__doc__(the package/module docstring) from the text in__meta__.__doc__toNone, since__init__.pyhas no module docstring. If the package docstring is still desired for introspection/help(), consider adding an explicit module docstring at the top of__init__.py(or set__doc__from__meta__.__doc__via a module import) instead of importing__doc__directly.
# package infos
from .__meta__ import ( # noqa
__author__,
__contact__,
__copyright__,
__credits__,
__email__,
__license__,
__status__,
__version__,
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Ruff rule A004 fired because
__doc__was imported from.__meta__intojsonrpyc/__init__.py, shadowing the Python builtin. The import was unused in the file.Changes
jsonrpyc/__init__.py— Remove__doc__from thefrom .__meta__ import (...)blockpyproject.toml— RemoveA004from[tool.ruff.lint] ignore