auth icon indicating copy to clipboard operation
auth copied to clipboard

added constants for builtin providers

Open josearomeroj opened this issue 2 years ago • 5 comments

Added type safety for builtin providers names

josearomeroj avatar Jan 09 '23 18:01 josearomeroj

Thank you for the pull request. Unfortunately, it seems that the changes made do not provide the type safety described in the description. Currently, the BuiltinProviderName type will happily accept a "naked string", meaning that there is nothing preventing a user from passing a regular string as the provider name.

Generally speaking, this PR is OK as it deduplicates usage of string constants but doesn't do what the PR description says.

Please update the description to reflect these changes and address the minor linter issue. Once that has been done, I will be happy to merge the pull request.

umputun avatar Jan 09 '23 18:01 umputun

Just added real type safety and fixed the lint issue

josearomeroj avatar Jan 09 '23 20:01 josearomeroj

This really is type-safe, but it breaks back compatibility for all the existing users. The previous method wasn't type-safe but was less destructive. Making such a change will require a new major version, and I see no reason to start v2 just for this thing.

Yes, you are right, this change is not that important to remove the backwards compatibility. Should I left it as it was before (Changing the commit message)?

josearomeroj avatar Jan 09 '23 20:01 josearomeroj

yep, just revert it to accept naked string and change the PR description

umputun avatar Jan 09 '23 20:01 umputun

Pull Request Test Coverage Report for Build 3877687112

  • 13 of 14 (92.86%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 95.72%

Changes Missing Coverage Covered Lines Changed/Added Lines %
auth.go 13 14 92.86%
<!-- Total: 13 14
Totals Coverage Status
Change from base Build 3832831444: 0.03%
Covered Lines: 246
Relevant Lines: 257

💛 - Coveralls

coveralls avatar Jan 23 '23 17:01 coveralls