Skip to content

Kill CLI and dispatch mutation survivors; annotate accepted diagnostics (#24, #25, #26, #29) - #32

Open
leynos wants to merge 5 commits into
mainfrom
kill-mutation-survivors
Open

Kill CLI and dispatch mutation survivors; annotate accepted diagnostics (#24, #25, #26, #29)#32
leynos wants to merge 5 commits into
mainfrom
kill-mutation-survivors

Conversation

@leynos

@leynos leynos commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Closes #24, #25, #26, #29.

Summary

First of two survivor-triage PRs following the 2026-07-10 mutmut 3.6.0
run on main @ 03b8ed1 (621 mutants; 381 killed; 217 survived; 23
with no covering tests). This PR:

The metrics-counter (#27) and install_patch gate (#28) survivors are
deferred to the stacked follow-up PR #33 to keep this change within the
agreed size tolerance for new test code.

Before/after survivor counts

State Mutants Killed Outstanding (survived + no tests)
main @ 03b8ed1 (baseline) 621 381 240
This PR (full mutmut run) 407 346 61

Review walkthrough

Red-green evidence

cli module (hand-applied x_main__mutmut_3,
sys.argv[1:]sys.argv[2:]):

=== RED: apply cli.x_main__mutmut_3 (sys.argv[1:] -> sys.argv[2:]) ===
tests/test_cli.py:45: AssertionError
FAILED tests/test_cli.py::test_main_defaults_to_sys_argv_tail
1 failed in 0.24s
=== GREEN: revert ===
1 passed in 0.19s

_patch module (hand-applied x__build_builtin_child__mutmut_11,
"dispatch.builtin""XXdispatch.builtinXX"):

=== RED: apply _patch.x__build_builtin_child__mutmut_11 ===
tests/test_patch_helpers.py: AssertionError
FAILED tests/test_patch_helpers.py::test_build_builtin_child_builds_method_descriptor_for_builtin
1 failed in 0.39s
=== GREEN: revert ===
1 passed in 0.39s

Validation

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Summary

  • Add mutation-survivor tests for _build_builtin_child, CLI execution, and dispatch argument propagation.
  • Cover imported members, builtins, aliases, metrics, real len dispatch, CLI argument forwarding, logging, exit statuses, patch installation, and idempotent patching.
  • Mark accepted diagnostic and equivalent mutants with # pragma: no mutate.
  • Refactor shared test factories and helpers to reduce duplication.
  • Run Ruff from the locked virtual environment through the Makefile.
  • Validate formatting, linting, type checking, and tests. Mutation testing killed 346 of 407 mutants; defer 61 survivors to follow-up PR #33.
  • Rebase or merge the CI coverage-upload changes from PR #34 before further pushes.
  • Close issues #24, #25, #26, and #29.

Walkthrough

Move Ruff execution into the virtual environment. Mark non-behavioural code for mutation suppression. Expand CLI and PyPy dispatch-helper tests for argument forwarding, status handling, aliases, cached children, and metrics.

Changes

Tooling and mutation coverage

Layer / File(s) Summary
Run Ruff from the virtual environment
.github/workflows/ci.yml, Makefile
Install Ruff in the virtual environment and run formatting and lint targets through uv run after build.
Mark non-behavioural mutation targets
pkg/pylint_pypy_shim/_patch.py, pkg/pylint_pypy_shim/cli.py
Add mutation-testing pragmas around diagnostic logging, typing casts, and unchanged installation and status logic.
Expand CLI and dispatch-helper coverage
tests/test_cli.py, tests/test_patch_helpers.py
Add reusable fake Pylint setup and tests for CLI forwarding, status handling, patching, builtin dispatch, aliases, cached children, and metrics.

Possibly related issues

Possibly related PRs

Suggested labels: Issue

Poem

Run Ruff inside the built environment,
Mark quiet logs for mutation’s intent,
Test every dispatch path and alias,
Let fake Pylint states reveal each status,
Ship clean checks with coverage sent.


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Developer Documentation ⚠️ Warning The PR changes Ruff to the locked dev virtualenv and makes lint targets depend on build, but no documentation changes explain this workflow in docs/developers-guide.md. Update docs/developers-guide.md to state that Ruff is installed from the dev group and that fmt, check-fmt, and lint use uv run after make build.
Testing (Property / Proof) ❓ Inconclusive Evidence collection is still in progress; no verdict submitted yet. Inspect the committed patch and test design before deciding whether a property test is required.
Unit Architecture ❓ Inconclusive Investigation is not complete. Gather source and test evidence before deciding.
✅ Passed checks (17 passed)
Check name Status Explanation
Title check ✅ Passed The title names the mutation-survivor work and links issues #24, #25, #26, and #29, so it matches the PR scope.
Description check ✅ Passed The description explains the survivor-killing tests, mutation pragmas, deferred work, and validation results.
Linked Issues check ✅ Passed The PR fulfils #24 with branch tests, exact argument forwarding, metric assertions, and genuine builtin dispatch coverage.
Out of Scope Changes check ✅ Passed All changes support the stated mutation-survivor objectives, including tests, annotations, and locked Ruff tooling execution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Testing (Overall) ✅ Passed Accept: CLI tests assert arguments, statuses, warnings, and patching; helper tests assert branch results, exact forwarding, metrics, and real builtin dispatch, with fixture isolation.
User-Facing Documentation ✅ Passed The source diff adds mutation pragmas and typing-only extraction; other changes are tests or CI/Makefile tooling. Existing CLI behaviour is already documented in docs/users-guide.md.
Module-Level Documentation ✅ Passed Keep this check passing: every Python module has a docstring; _patch.py documents its purpose, utility, Astroid relationship, and side effects.
Testing (Unit And Behavioural) ✅ Passed Accept the check: tests cover builtin/imported branches, metric invariants, cached-child errors, dispatch forwarding, CLI status paths, and existing subprocess CLI scenarios cover the user boundary.
Testing (Compile-Time / Ui) ✅ Passed Apply no trybuild requirement because the repository has no Rust or TypeScript files; retain the focused CLI snapshot and exact warning assertion for output behaviour.
Domain Architecture ✅ Passed The change stays in Pylint/Astroid adapter code, CLI integration, build tooling, and tests; it adds no domain model or domain-to-infrastructure dependency.
Observability ✅ Passed The PR adds tests, mutation pragmas, and CI/development Ruff wiring; runtime paths, logs, metrics, tracing, and alerts are unchanged, while existing decision and failure signals remain.
Security And Privacy ✅ Passed Accept the change: the diff adds no credentials or sensitive data, changes no authorisation boundary, and routes Ruff through the locked virtual environment.
Performance And Resource Use ✅ Passed Keep this change: production edits add only no-op casts and diagnostic pragmas; no new unbounded collections or loops appear, and Ruff uses the locked virtual environment.
Concurrency And State ✅ Passed Accept this check: the PR adds no runtime shared state; existing _PATCH_LOCK and _METRICS_LOCK guard installation and metrics, with concurrent tests covering both paths.
Architectural Complexity And Maintainability ✅ Passed Keep the change. Production code adds no new architecture; local test helpers have immediate reuse, and Ruff uses the existing locked dev dependency via explicit Makefile targets.
Rust Compiler Lint Integrity ✅ Passed PASS: The PR touches Python, Makefile, and CI files only; the checkout contains zero Rust files and no Rust lint suppressions or clone calls.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kill-mutation-survivors

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds focused unit tests to kill previously surviving mutation testing cases in the CLI wrapper and object-dispatch helpers, and annotates accepted debug/info log lines and typing-only casts with # pragma: no mutate so future mutation runs ignore non-behavioural mutants, while preserving dispatch and CLI semantics via small refactors.

File-Level Changes

Change Details Files
Add tests pinning builtin/class dispatch and object-build behaviour, including metrics and argument forwarding, for the Astroid patch helpers.
  • Introduce _RecordingImportedBuilder to record imported_member calls and drive imported vs non-imported branches.
  • Add tests for _build_builtin_child and _build_class_child covering imported-member short-circuiting, method-descriptor construction, and error messaging when cached children have the wrong type.
  • Add tests for _dispatch_member_to_child, const-special attribute handling, and non-PyPy class_getitem behaviour, asserting correct metrics and alias forwarding.
  • Add tests ensuring _object_build_without_pypy_descriptor_aliases and _object_build_with_logger correctly route resolved members through the PyPy builtin path or generic dispatch.
tests/test_patch_helpers.py
Add CLI tests that pin argv handling, logger wiring, legacy Run behaviour, msg_status fallback, and non-integer SystemExit warnings.
  • Factor helper _install_fake_pylint to install fake pylint and pylint.lint modules exposing a configurable Run class.
  • Add tests asserting main(None) forwards sys.argv[1:], passes the CLI module logger to install_patch, defaults to status 0 when linter lacks msg_status, and supports legacy Run(argv) APIs.
  • Add a test confirming _system_exit_code_to_status logs the exact non-integer-status warning message and falls back to status 0.
tests/test_cli.py
Annotate debug/info logging and typing-only casts in the Astroid patch implementation so mutation testing ignores non-behavioural mutants without weakening functional coverage.
  • Add module-level commentary and # pragma: no mutate annotations around debug/info logging and temporary variables holding typ.cast results in _patch, using start/end blocks for multi-line log calls.
  • Refactor some calls (e.g., object_build_methoddescriptor, object_build_datadescriptor, _build_from_function, InspectBuilder.object_build assignment) to pass through named temporary variables that carry the pragma annotations.
  • Mark non-behavioural helpers like _object_build_without_pypy_descriptor_aliases’ logger wiring, the version-major split in _is_supported_version, and the strict-mode environment default as no-mutate lines while leaving behaviour unchanged.
pkg/pylint_pypy_shim/_patch.py
Annotate CLI debug logs related to legacy Run and SystemExit handling to suppress non-behavioural mutation warnings while keeping behaviour intact.
  • Wrap the legacy Run-path debug log in main with a pragma no-mutate block, documenting that diagnostic logs carry no behavioural contract.
  • Mark debug logs in _system_exit_code_to_status for None and integer statuses as no-mutate lines, so mutation testing focuses on the warning path and return values.
pkg/pylint_pypy_shim/cli.py

Assessment against linked issues

Issue Objective Addressed Explanation
#24 Add unit tests for _build_builtin_child that exercise both the imported and non-imported branches, verifying that imported_member is called with exactly (node, member, alias) and that the correct value (None or the method-descriptor child) is returned.
#24 Add tests that verify the metrics counters for _build_builtin_child, ensuring that dispatch.imported and dispatch.builtin are incremented exactly once with the correct keys when their respective branches are taken.
#24 Add an integration-style test that dispatches a genuine builtin member through _dispatch_member_to_child, ensuring the builtin branch is taken and a child node is built/attached. The new tests exercise _build_builtin_child directly and cover class/const dispatch and PyPy builtin-path wiring, but there is no test that calls _dispatch_member_to_child with a real builtin (e.g. len) and asserts that the builtin branch is taken and a child is attached.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@leynos

leynos commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

Review findings actioned in d125051:

  • CodeScene — Code Duplication (tests/test_cli.py, tests/test_patch_helpers.py): extracted a shared _make_modern_run factory for the modern Run stand-ins, routed all fake pylint module setup through _install_fake_pylint, and folded the two object-build member-forwarding tests into a single parametrized test.
  • Sourcery — missing integration-style builtin dispatch test (issue Mutation testing: _build_builtin_child untested-path survivors #24, suggestion 3): added test_dispatch_member_to_child_builds_real_builtin_child, which routes a genuine builtin (len) through _dispatch_member_to_child and asserts a child is built with the dispatch.builtin counter recorded.

A full mutmut run at the new tip still reports 407 generated / 346 killed / 61 survived, with all 61 survivors deferred to #33.

@leynos

leynos commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

Heads-up: #34 replaced ci.yml's bespoke cs-coverage upload step (which CodeScene rejects on pull-request branches) with the shared generate-coverage action, and the CS_ACCESS_TOKEN secret is now set repo-wide. This branch's head still carries the old ci.yml, so its next CI run would execute the old upload step and fail. Please rebase onto (or merge) main before pushing further changes.

@leynos leynos changed the title Kill CLI and dispatch mutation survivors; annotate accepted diagnostics Kill CLI and dispatch mutation survivors; annotate accepted diagnostics (#24, #25, #26, #29) Jul 17, 2026
codescene-access[bot]

This comment was marked as outdated.

leynos added 5 commits July 18, 2026 20:44
Cover gaps harvested from the 2026-07-10 mutmut run:

- _build_builtin_child imported/builtin branches, exact argument
  forwarding, and metric keys (issue #24)
- CLI argv slicing, install_patch logger wiring, msg_status fallback,
  legacy Run path, and the non-integer-status warning (issue #25)
- dispatch argument propagation, the const special-attribute gate, the
  PyPy __class_getitem__ gate, and PatchError message content
  (issue #26)
Annotate diagnostic debug/info log lines in _patch.py and cli.py with
"pragma: no mutate" (issue #29): their message content carries no
behavioural contract, so string and argument mutants on those lines
survive without indicating a test gap.

Also annotate the equivalent mutants recorded in the triage worklist:
typing-only typ.cast type strings (extracted onto dedicated lines so
the suppression does not mask argument-forwarding mutants elsewhere in
the same call), the _object_build_with_logger logger fallback, the
version-string maxsplit variant, and the strict-mode default string.
Action the CodeScene code-duplication findings on the survivor-triage
tests: extract a _make_modern_run factory shared by the modern Run
stand-ins in test_cli.py, route all fake pylint module setup through
_install_fake_pylint, and fold the two object-build member-forwarding
tests into one parametrized test.

Also add the integration-style dispatch test suggested by the Sourcery
review: a genuine builtin routed through _dispatch_member_to_child
takes the builtin branch and yields a child.
Add module docstring notes to `test_cli.py` and `test_patch_helpers.py`
naming the mutation-survivor issues each file's new tests kill (#24,
#25, #26), so the kill sites are traceable back to the triage issues
without relying solely on the PR body.
CI installed ruff as a bare global tool, so it always ran whatever
release was newest on PyPI rather than the version pinned in uv.lock.
Ruff 0.15.22 introduced the noqa-comments rule and broke this PR's
diff on a version the repository had not adopted yet, repeating the
drift the estate has already hit and fixed elsewhere. Route ruff
through the synced dev virtualenv instead, matching how pytest is
already resolved, so `make lint`/`check-fmt`/`fmt` use the pinned
release and CI no longer fetches an unpinned one.
@leynos
leynos force-pushed the kill-mutation-survivors branch from d9724d5 to 845a5b2 Compare July 18, 2026 18:48
codescene-access[bot]

This comment was marked as outdated.

@codescene-access codescene-access Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No quality gates enabled for this code.

@leynos
leynos marked this pull request as ready for review July 25, 2026 14:52

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @leynos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@buzzybee-df12

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot added the Issue label Aug 6, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_cli.py`:
- Line 42: Replace the broad suppression on the __init__ parameter exit in
tests/test_cli.py:42 with the narrow Ruff code A002 and add a brief
justification. Also update the suppression at tests/test_patch_helpers.py:1151
to use FBT001, preserving its existing justification.

In `@tests/test_patch_helpers.py`:
- Around line 993-996: The _RecordingImportedBuilder.imported_member method
should explicitly indicate that it overrides its base-class method. Import and
apply typing_extensions.override, and add typing_extensions to the project’s
development dependencies while preserving the existing method behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2cf852b2-a65a-481b-8278-3309820113f8

📥 Commits

Reviewing files that changed from the base of the PR and between 8b0ca2e and 845a5b2.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • Makefile
  • pkg/pylint_pypy_shim/_patch.py
  • pkg/pylint_pypy_shim/cli.py
  • tests/test_cli.py
  • tests/test_patch_helpers.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Comment thread tests/test_cli.py
"""Build a modern ``Run`` stand-in recording ``(argv, exit)`` calls."""

class FakeRun:
def __init__(self, argv: list[str], *, exit: bool) -> None: # ruff:ignore[builtin-argument-shadowing]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

set -eu
printf '%s\n' '--- Ruff configuration ---'
find . -maxdepth 3 -type f \( -name 'pyproject.toml' -o -name 'ruff.toml' -o -name '.ruff.toml' -o -name 'setup.cfg' \) -print
printf '%s\n' '--- Target lines ---'
sed -n '35,48p' tests/test_cli.py
sed -n '1144,1157p' tests/test_patch_helpers.py
printf '%s\n' '--- Rule definitions and suppression policy references ---'
rg -n -C 3 'builtin-argument-shadowing|boolean-type-hint-positional-argument|noqa|ruff:ignore|lint' pyproject.toml ruff.toml .ruff.toml setup.cfg .rules tests 2>/dev/null || true

Repository: leynos/pylint-pypy-shim

Length of output: 34409


🏁 Script executed:

set -eu
printf '%s\n' '--- Complete Ruff lint selection ---'
sed -n '30,96p' pyproject.toml
printf '%s\n' '--- Repository suppression style ---'
rg -n '# noqa:|# ruff:ignore' --glob '*.py' .
printf '%s\n' '--- Ruff availability and rule diagnostics ---'
if command -v ruff >/dev/null 2>&1; then
    ruff --version
    ruff check tests/test_cli.py tests/test_patch_helpers.py --output-format concise 2>&1 || true
else
    printf '%s\n' 'ruff is not installed in the sandbox'
fi

Repository: leynos/pylint-pypy-shim

Length of output: 4744


🏁 Script executed:

set -eu
printf '%s\n' '--- Ruff rule metadata ---'
ruff rule builtin-argument-shadowing --output-format json
ruff rule boolean-type-hint-positional-argument --output-format json
printf '%s\n' '--- Direct diagnostics with Ruff suppressions removed in-memory ---'
python3 - <<'PY'
from pathlib import Path
files = [Path("tests/test_cli.py"), Path("tests/test_patch_helpers.py")]
for path in files:
    text = path.read_text()
    text = text.replace("ruff:ignore[builtin-argument-shadowing]", "noqa: INVALID")
    text = text.replace(
        "ruff:ignore[boolean-type-hint-positional-argument]",
        "noqa: INVALID",
    )
    Path("/tmp")  # keep this verifier read-only with respect to the repository
    out = Path("/tmp") / f"{path.name}.ruff-probe.py"
    out.write_text(text)
    print(out)
PY
ruff check /tmp/test_cli.py.ruff-probe.py /tmp/test_patch_helpers.py.ruff-probe.py --output-format concise 2>&1 || true

Repository: leynos/pylint-pypy-shim

Length of output: 6120


Use narrow # noqa suppressions with the correct Ruff codes.

Replace the directives with # noqa: A002 at tests/test_cli.py:42 and # noqa: FBT001 at tests/test_patch_helpers.py:1151. Add a brief justification to the A002 suppression and retain the existing justification for FBT001.

📍 Affects 2 files
  • tests/test_cli.py#L42-L42 (this comment)
  • tests/test_patch_helpers.py#L1151-L1151
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_cli.py` at line 42, Replace the broad suppression on the __init__
parameter exit in tests/test_cli.py:42 with the narrow Ruff code A002 and add a
brief justification. Also update the suppression at
tests/test_patch_helpers.py:1151 to use FBT001, preserving its existing
justification.

Sources: Coding guidelines, Path instructions

Comment on lines +993 to +996
def imported_member(self, node: object, member: object, alias: str) -> bool:
"""Record the exact arguments and return the canned verdict."""
self.imported_member_calls.append((node, member, alias))
return self._imported

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

set -eu
printf '%s\n' '--- project metadata ---'
find . -maxdepth 2 -type f \( -name 'pyproject.toml' -o -name 'setup.cfg' -o -name 'tox.ini' -o -name 'pytest.ini' \) -print
printf '%s\n' '--- relevant imports and class definitions ---'
rg -n -C 4 'imported_member|RecordingImportedBuilder|typing\.override|from typing import|python_requires|requires-python|target-version' tests/test_patch_helpers.py pyproject.toml setup.cfg tox.ini 2>/dev/null || true
printf '%s\n' '--- Python-version declarations ---'
rg -n -i 'python ?3|requires-python|target-version|pyright|typing-extensions' . -g '!*.lock' -g '!*.json' 2>/dev/null | head -200
printf '%s\n' '--- test file header ---'
sed -n '1,80p' tests/test_patch_helpers.py
printf '%s\n' '--- target section ---'
sed -n '960,1010p' tests/test_patch_helpers.py

Repository: leynos/pylint-pypy-shim

Length of output: 10664


🏁 Script executed:

set -eu
printf '%s\n' '--- dependency and typing configuration ---'
sed -n '1,90p' pyproject.toml
rg -n -i 'typing_extensions|override|python_version|pythonpath|typeCheckingMode' . -g '*.py' -g '*.pyi' -g '*.toml' -g '*.cfg' -g '*.ini' -g '*.md' 2>/dev/null | head -200
printf '%s\n' '--- FakeBuilder declaration and imported_member contract ---'
rg -n -C 8 'class FakeBuilder|def imported_member' tests/test_patch_support.py pkg tests 2>/dev/null | head -160
printf '%s\n' '--- supported-version documentation ---'
sed -n '210,235p' docs/developers-guide.md

Repository: leynos/pylint-pypy-shim

Length of output: 9075


🏁 Script executed (no clone):

set -eu
python3 - <<'PY'
import sys
import typing

print(f"runtime={sys.version_info.major}.{sys.version_info.minor}")
print(f"typing.override_available={hasattr(typing, 'override')}")
try:
    import typing_extensions
except ImportError:
    print("typing_extensions_available=False")
else:
    print(f"typing_extensions_available=True")
    print(f"typing_extensions.override_available={hasattr(typing_extensions, 'override')}")
PY

Length of output: 203


Add an override marker to _RecordingImportedBuilder.imported_member. Use typing_extensions.override because the project supports Python 3.11, where typing.override is unavailable. Add typing_extensions to the development dependencies.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_patch_helpers.py` around lines 993 - 996, The
_RecordingImportedBuilder.imported_member method should explicitly indicate that
it overrides its base-class method. Import and apply typing_extensions.override,
and add typing_extensions to the project’s development dependencies while
preserving the existing method behavior.

Source: Coding guidelines

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mutation testing: _build_builtin_child untested-path survivors

2 participants