Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/twyn/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def _get_dependencies_list(
def _get_selector_method(selector_method: str) -> SelectorMethod:
"""Return the selector_method from set of available ones."""
if selector_method not in SELECTOR_METHOD_MAPPING:
InvalidSelectorMethodError("Invalid selector method")
raise InvalidSelectorMethodError("Invalid selector method")
Comment on lines 281 to +282
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

The raised error message is quite generic. For parity with the config validation (e.g., listing allowed selector methods), consider including the invalid value and the valid options (from SELECTOR_METHOD_MAPPING.keys()) to make CLI/config failures easier to diagnose.

Copilot uses AI. Check for mistakes.

Comment on lines 279 to 283
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

The return type annotation appears incorrect: SelectorMethod (from twyn.base.constants) is a Literal[...] of method names, but this function returns an instantiated selector (SELECTOR_METHOD_MAPPING[selector_method]()), not the string key. Consider updating the return type (and related parameter annotations where this value is passed around) to the appropriate selector base type/protocol to avoid misleading typing.

Copilot uses AI. Check for mistakes.
return SELECTOR_METHOD_MAPPING[selector_method]()

Expand Down
Loading