Skip to content

Fix A004: remove __doc__ import shadowing Python builtin#201

Open
Copilot wants to merge 3 commits intomainfrom
copilot/fix-linter-error-a004
Open

Fix A004: remove __doc__ import shadowing Python builtin#201
Copilot wants to merge 3 commits intomainfrom
copilot/fix-linter-error-a004

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

Ruff rule A004 fired because __doc__ was imported from .__meta__ into jsonrpyc/__init__.py, shadowing the Python builtin. The import was unused in the file.

Changes

  • jsonrpyc/__init__.py — Remove __doc__ from the from .__meta__ import (...) block
  • pyproject.toml — Remove A004 from [tool.ruff.lint] ignore

Copilot AI linked an issue Apr 2, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix linter error A004 and remove from suppression list Fix A004: remove __doc__ import shadowing Python builtin Apr 2, 2026
Copilot AI requested a review from kevinbackhouse April 2, 2026 15:16
@kevinbackhouse kevinbackhouse marked this pull request as ready for review April 2, 2026 15:30
Copilot AI review requested due to automatic review settings April 2, 2026 15:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the jsonrpyc/__init__.py metadata import list to avoid A004.
  • Remove A004 from [tool.ruff.lint].ignore so 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 changes jsonrpyc.__doc__ (the package/module docstring) from the text in __meta__.__doc__ to None, since __init__.py has 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A004

3 participants