Skip to content

test/lint/lint-python-dead-code false positives #34810

Closed

Description

@ajtowns

Looks like recent versions of vulture are triggering false positives on while True loops with internal breaks.

Failure: https://github.com/bitcoin/bitcoin/actions/runs/22981056848/job/66720754466?pr=34628

Upstream issue: jendrikseipp/vulture#412

I guess the triggering change was: jendrikseipp/vulture#378

Activity

  1. maflcko commented on Mar 12, 2026

    @maflcko
    Member

    I wonder if this tool ever found a real true positive, given that we are running it at confidence=100%, which can only find very limited things? Sure, dead code in tests isn't ideal and possibly scary, but if this only finds the plain obvious cases, that are unlikely to be written, and trivial to catch during manual review, maybe it could be removed?

    No strong opinion, just wondering. In the meantime, I've submitted #34814

  2. fanquake commented on Mar 12, 2026

    @fanquake
    Member

    I was hoping that it's functionality would just be ingested by ruff at some point: astral-sh/ruff#872

  3. willcl-ark commented on Mar 12, 2026

    @willcl-ark
    Member

    Yes I've been hoping astral would pick this up too for some time, but it seems like for now, all astral has on this front (via ty) is unused variable detection and a few other easy-to-spot types. But no "unused classes or functions". AFAIU there seems to be some barriers on how to implement sanely for python, as there's not an obious way to do it outside of parsing all files for all usage of all classes etc. as everything in python in public.

    ty has a similar issue here: astral-sh/ty#2829, and I might slightly expect it to be added there rather than ruff...

  4. added 2 commits that reference this issue on Mar 12, 2026
  5. fanquake commented on Mar 12, 2026

    @fanquake
    Member

    Closing via #34814.

  6. maflcko commented on Mar 12, 2026

    @maflcko
    Member

    all astral has on this front (via ty) is unused variable detection and a few other easy-to-spot types. But no "unused classes or functions".

    I think this is also what vulture does for us, no? Unused classes and functions need to be manually removed, see 5c00536

    I guess it could help to have a set of MWE what vulture catches today for use, and what ty catches. If they are the same, it could make sense to use ty.

  7. willcl-ark commented on Mar 12, 2026

    @willcl-ark
    Member

    I guess it could help to have a set of MWE what vulture catches today for use, and what ty catches. If they are the same, it could make sense to use ty.

    I could try and work something like that out. I do have #34547 open to switch to ty (amongst other things) already :)

  8. maflcko commented on Mar 12, 2026

    @maflcko
    Member

    (Also, GitHub changed the merge commit refresh schedule https://github.blog/changelog/2026-02-19-changes-to-test-merge-commit-generation-for-pull-requests/, since the current commit was 10h old, not 12h, I closed and re-opened the pull to re-trigger)

  9. 3 remaining items

  10. willcl-ark commented on Mar 12, 2026

    @willcl-ark
    Member

    So we may consider removing vulture?

    I believe so

  11. maflcko commented on Mar 12, 2026

    @maflcko
    Member
  12. added a commit that references this issue on Mar 16, 2026
  13. added 3 commits that reference this issue on Jun 28, 2026
  14. added 3 commits that reference this issue on Jun 30, 2026
  15. added 3 commits that reference this issue on Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions