Skip to content

Fix replace command callback signature#6700

Open
Tsuizxgo wants to merge 1 commit into
beetbox:masterfrom
Tsuizxgo:fix-replace-command-signature
Open

Fix replace command callback signature#6700
Tsuizxgo wants to merge 1 commit into
beetbox:masterfrom
Tsuizxgo:fix-replace-command-signature

Conversation

@Tsuizxgo
Copy link
Copy Markdown

@Tsuizxgo Tsuizxgo commented Jun 1, 2026

Description

Fixes #6260.

The replace plugin assigns ReplacePlugin.run directly as the replace command callback. Beets command callbacks are invoked with (lib, opts, args), but ReplacePlugin.run only accepted (lib, args), so invoking the command raised:

TypeError: ReplacePlugin.run() takes 3 positional arguments but 4 were given

This change updates the callback signature to accept the options argument and adds regression coverage for invoking beet replace through the command runner.

To Do

  • Documentation. This is a bug fix for an existing command.
  • Changelog. Added an entry to docs/changelog.rst.
  • Tests. Added regression coverage for the command callback path.

Tests

BEETSDIR=/private/tmp/beets-test-config UV_CACHE_DIR=/private/tmp/uv-cache uv run pytest test/plugins/test_replace.py
# 10 passed

@Tsuizxgo Tsuizxgo requested a review from a team as a code owner June 1, 2026 16:03
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.61%. Comparing base (52a7ba6) to head (d06774b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6700      +/-   ##
==========================================
+ Coverage   72.59%   72.61%   +0.01%     
==========================================
  Files         162      162              
  Lines       20811    20811              
  Branches     3293     3293              
==========================================
+ Hits        15107    15111       +4     
+ Misses       4980     4975       -5     
- Partials      724      725       +1     
Files with missing lines Coverage Δ
beetsplug/replace.py 60.27% <100.00%> (+5.47%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@semohr semohr left a comment

Choose a reason for hiding this comment

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

Thanks!

@semohr semohr enabled auto-merge (rebase) June 4, 2026 11:50
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.

Replace plugin does not work

2 participants