Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo #499

Merged
merged 2 commits into from
Nov 12, 2024
Merged

Fix typo #499

merged 2 commits into from
Nov 12, 2024

Conversation

DrRac27
Copy link
Contributor

@DrRac27 DrRac27 commented Nov 12, 2024

This typo made it silently fail for me so maybe it would make sense to additionally check if a valid Literal was passed?

Thanks for this awesome library btw, I really appreciate it!

@rmartin16
Copy link
Owner

Ah, indeed; NoSubfolder is the correct value. Thanks for the PR.

This typo made it silently fail for me so maybe it would make sense to additionally check if a valid Literal was passed?

In general, I have avoided too much validation of the inputs and instead deferred to whatever qBittorrent does with bad inputs. This is mostly because it can be difficult to know accepted values....and when they change over time, it's difficult to then accurately represent the supported values to user of this API.

Nonetheless, this Literal will validate the value for devs using type checkers or IDEs with type checking enabled. So, I think that's far enough towards validating this value for users.

And it appears to make matters even more embarrassing for me.....I spelled the value correctly a little lower down and then told mypy to stop pestering me about it....lol

        if (
            content_layout is None
            and is_root_folder is not None
            and api_version >= v("2.7")
        ):
            content_layout = "Original" if is_root_folder else "NoSubfolder"  # type: ignore[assignment]

If you wouldn't mind removing # type: ignore[assignment], then CI will be able to proceed.

@DrRac27
Copy link
Contributor Author

DrRac27 commented Nov 12, 2024

Nonetheless, this Literal will validate the value for devs using type checkers or IDEs with type checking enabled. So, I think that's far enough towards validating this value for users.

You are right, better keep it maintainable :)

And it appears to make matters even more embarrassing for me.....I spelled the value correctly a little lower down and then told mypy to stop pestering me about it....lol

Haha happens to all of us 😄

If you wouldn't mind removing # type: ignore[assignment], then CI will be able to proceed.

Done :)

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (301acef) to head (56e17ce).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #499   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines         1844      1844           
  Branches       197       104   -93     
=========================================
  Hits          1844      1844           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@rmartin16 rmartin16 left a comment

Choose a reason for hiding this comment

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

thanks for the fix! definitely appreciate it.

@rmartin16 rmartin16 merged commit ce9960e into rmartin16:main Nov 12, 2024
36 checks passed
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