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: the interactive confirm answers should match the confirm/reject text #382

Merged
merged 3 commits into from Jul 26, 2022

Conversation

luisdavim
Copy link
Contributor

@luisdavim luisdavim commented Jul 24, 2022

Description

The lib allows specifying the confirmation and rejection text but hardcodes the answers to yes or no, this aims to fix that.
Fixing this issue helps with internationalisation, for example, in most Latin based languages the suffix should be [s/N] instead of [y/N] (in French it would probably be [o/N])

Note: I've disabled the gocritic complaint regarding preferDecodeRune as I don't think it would make sense to use utf8.DecodeRuneInString in this situation.
Ideally, gocritic should allow disabling the rule for a single line with a comment in the code, but that doesn't seem to be possible at the moment...

Scope

Interactive Confirm Printer

  • Bug Fix
  • New Feature
  • Documentation
  • Other

To-Do Checklist

  • I tested my changes
  • I have commented every method that I created/changed
  • I updated the examples to fit with my changes
  • I have added tests for my newly created methods

…text

Signed-off-by: Luis Davim <luis.davim@sendoso.com>
@codecov
Copy link

codecov bot commented Jul 24, 2022

Codecov Report

Merging #382 (561cda9) into master (8acc75a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #382   +/-   ##
=======================================
  Coverage   82.04%   82.05%           
=======================================
  Files          28       28           
  Lines        2005     2006    +1     
=======================================
+ Hits         1645     1646    +1     
  Misses        348      348           
  Partials       12       12           
Impacted Files Coverage Δ
interactive_confirm_printer.go 91.93% <100.00%> (+0.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8acc75a...561cda9. Read the comment docs.

@github-actions github-actions bot added fix and removed fix labels Jul 24, 2022
Copy link
Member

@MarvinJWendt MarvinJWendt left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for contributing 🥳

@MarvinJWendt MarvinJWendt merged commit c358754 into pterm:master Jul 26, 2022
@MarvinJWendt
Copy link
Member

Hi @luisdavim, thanks for the PR!

BTW: You can disable linting for specific lines: https://golangci-lint.run/usage/false-positives/#nolint-directive 😉

@luisdavim luisdavim deleted the confirm_answers branch July 26, 2022 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants