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

If product not found, offer a suggestion #132

Merged
merged 2 commits into from
Feb 6, 2023
Merged

If product not found, offer a suggestion #132

merged 2 commits into from
Feb 6, 2023

Conversation

hugovk
Copy link
Owner

@hugovk hugovk commented Feb 5, 2023

If the product is not found, suggest the closest one.

For example:

$ eol androd
Product 'androd' not found, run 'eol all' for list. Did you mean: 'android'?
$ eol pythn
Product 'pythn' not found, run 'eol all' for list. Did you mean: 'python'?
$ eol samsung
Product 'samsung' not found, run 'eol all' for list. Did you mean: 'samsung-mobile'?

Similar to the improved error messages in Python 3.10 and 3.12.

Also refactor norwegianblue() to raise ValueError on 404 instead of returning.

@hugovk hugovk added enhancement New feature or request changelog: Added For new features labels Feb 5, 2023
@codecov
Copy link

codecov bot commented Feb 5, 2023

Codecov Report

Merging #132 (018077a) into main (faf68bc) will increase coverage by 0.15%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #132       /-   ##
==========================================
  Coverage   95.23%   95.39%    0.15%     
==========================================
  Files           9        9              
  Lines         378      391       13     
==========================================
  Hits          360      373       13     
  Misses         18       18              
Flag Coverage Δ
macos-latest 95.39% <100.00%> ( 0.15%) ⬆️
ubuntu-latest 95.39% <100.00%> ( 0.15%) ⬆️
windows-latest 95.39% <100.00%> ( 0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/norwegianblue/cli.py 0.00% <ø> (ø)
src/norwegianblue/__init__.py 98.61% <100.00%> ( 0.10%) ⬆️
tests/test_norwegianblue.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Added For new features enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant