Skip to content

removing ambiguous keyword bool arg calls - #337

Merged
jtpavlock merged 4 commits into
mainfrom
lint_checks
Nov 18, 2025
Merged

jtpavlock merged 4 commits into
mainfrom
lint_checks

Conversation

@jtpavlock

@jtpavlock jtpavlock commented Nov 11, 2025 •

Copy link
Copy Markdown
Member
  • I have read the contributing guide in the documentation.

Description

This removes the ability to call any boolean arguments in function just by passing True or "False" and forces them to be passed by keyword such as overwrite=False.

The following functions changed:

  • transcode() : overwrite is now a keyword forced arg
  • edit_item(): create_field is now keyword only
  • Config(): init_db in __init__ is now keyword only
  • merge(): Merge methods in library items (albums, tracks, and extras) now take an enum instead of a bool in order to support future merging strategies without introducing breaking changes.

See each commit for more details on each specific change. These are all breaking changes.

Additional information

See ruff FBT001 and FBT002 for more info.


📚 Documentation preview 📚: https://mrmoe--337.org.readthedocs.build/en/337/

@codecov

codecov Bot commented Nov 11, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.87%. Comparing base (8eda85b) to head (adebbe1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #337   +/-   ##
=======================================
  Coverage   94.86%   94.87%           
=======================================
  Files          58       58           
  Lines        2746     2751    +5     
=======================================
+ Hits         2605     2610    +5     
  Misses        141      141           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ali-ramadhan ali-ramadhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Didn't know about FBT001 and FBT002 but I'm a big fan.

Since this is a breaking change are we accumulating changes to release v3.0 with no more v2.x releases?

@ali-ramadhan ali-ramadhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might have found a bug and an opportunity to add a test so I'm requesting changes instead of approving. But let me know if I'm wrong!

Comment thread moe/library/album.py Outdated
Forcing the init_db argument to be keyword only minimizes confusion and improves readability.

@ali-ramadhan ali-ramadhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for fixing!

Replaces the `overwrite` bool argument in library item `merge` methods with a new `MergeStrategy` enum. This increases readability and allows for future implementation merge strategies without introducing new breaking changes.
Forcing the argument to be keyword only increases readability.
@jtpavlock
jtpavlock merged commit 1e16792 into main Nov 18, 2025
20 checks passed
@jtpavlock
jtpavlock deleted the lint_checks branch November 18, 2025 15:48
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.

2 participants