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

src: kw_remote: Fix not failing when missing valid options #770

Closed
wants to merge 1 commit into from

Conversation

davidbtadokoro
Copy link
Collaborator

Before this commit, kw remote did not validate if the command had valid option, i.e., calling kw remote (without option/parameters) or calling kw remote (without valid option) did not fail, although it did not seems to have any side effect.

Now we validate if any of the options add, remove, rename, list or set default remote were passed at the end of parse_remote_options(). If not, the command fails.

Chose to validate at the end of parse_remote_options() as 1) it seems the responsability of this function and 2) it enables to make a simple unit test for this case.

Closes #728

Signed-off-by: David Tadokoro davidbtadokoro@usp.br

Before this commit, kw remote did not validate if the command had valid
option, i.e., calling kw remote (without option/parameters) or calling
kw remote <name> <remote> (without valid option) did not fail, although
it did not seems to have any side effect.

Now we validate if any of the options add, remove, rename, list or set
default remote were passed at the end of parse_remote_options(). If not,
the command fails.

Chose to validate at the end of parse_remote_options() as 1) it seems
the responsability of this function and 2) it enables to make a simple
unit test for this case.

Closes kworkflow#728

Signed-off-by: David Tadokoro <davidbtadokoro@usp.br>
@codecov-commenter
Copy link

Codecov Report

Base: 73.21% // Head: 73.21% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (38f558d) compared to base (41341d9).
Patch coverage: 66.66% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable     #770      +/-   ##
============================================
- Coverage     73.21%   73.21%   -0.01%     
============================================
  Files            41       41              
  Lines          6859     6865       +6     
============================================
+ Hits           5022     5026       +4     
- Misses         1837     1839       +2     
Impacted Files Coverage Δ
src/kw_remote.sh 70.85% <66.66%> (-0.14%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rodrigosiqueira
Copy link
Collaborator

Very nice improvement! Thanks a lot.
PR merged in the unstable branch.

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.

None yet

3 participants