Skip to content

Conversation

@9999years
Copy link
Contributor

Description

This adds type annotations to beetsplug.duplicates.

To Do

  • Documentation. (If you've added a new command-line flag, for example, find the appropriate page under docs/ to describe it.)
  • Changelog. (Add an entry to docs/changelog.rst to the bottom of one of the lists near the top of the document.)
  • Tests. (Very much encouraged but not strictly required.)

@9999years 9999years requested a review from a team as a code owner January 19, 2026 19:49
Copilot AI review requested due to automatic review settings January 19, 2026 19:49
@github-actions
Copy link

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

Copy link
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

This pull request adds type annotations to the beetsplug/duplicates.py plugin to improve type safety and code documentation.

Changes:

  • Added from __future__ import annotations and imported typing utilities (TYPE_CHECKING, Any, DefaultDict, Iterator, Tuple, TypeAlias, cast)
  • Added type aliases Tiebreak and KeyValues to document complex types used throughout the code
  • Added type annotations to method signatures including _dup, _process_item, _checksum, _group_by, _order, _merge_albums, and _duplicates
  • Added type annotations to local variables in the _dup function with # type: ignore comments
  • Fixed variable shadowing issue in _duplicates method by renaming loop variable from objs to grouped_objs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return sorted(objs, key=key, reverse=True)
return sorted(objs, key=key, reverse=True) # type: ignore

def _merge_items(self, objs):
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Missing type annotations for the objs parameter and return type. Based on the implementation and similar method _merge_albums, the signature should be def _merge_items(self, objs: list[Item]) -> list[Item]:.

Suggested change
def _merge_items(self, objs):
def _merge_items(self, objs: list[Item]) -> list[Item]:

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 26.31579% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.75%. Comparing base (9b1bd5d) to head (bc2a94c).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
beetsplug/duplicates.py 26.31% 28 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6307      +/-   ##
==========================================
- Coverage   68.76%   68.75%   -0.01%     
==========================================
  Files         140      140              
  Lines       18610    18617       +7     
  Branches     3051     3052       +1     
==========================================
+ Hits        12797    12801       +4     
- Misses       5165     5168       +3     
  Partials      648      648              
Files with missing lines Coverage Δ
beetsplug/duplicates.py 21.51% <26.31%> (+1.51%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@9999years 9999years force-pushed the wiggles/mkym branch 2 times, most recently from ff64e10 to 993cba2 Compare January 19, 2026 20:59
This adds type annotations to `beetsplug.duplicates`.
@9999years 9999years marked this pull request as draft January 19, 2026 21:03
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.

1 participant