-
Notifications
You must be signed in to change notification settings - Fork 145
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 issue #71 -Wrong contribution type being added to .all-contributorsrc #78
fix issue #71 -Wrong contribution type being added to .all-contributorsrc #78
Conversation
Codecov Report
@@ Coverage Diff @@
## master #78 +/- ##
==========================================
+ Coverage 53.99% 57.81% +3.82%
==========================================
Files 19 19
Lines 413 422 +9
Branches 68 70 +2
==========================================
+ Hits 223 244 +21
+ Misses 161 149 -12
Partials 29 29
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! Do you think you could add a test?
Yes I can add |
should I make a new file under test folder for prompt, since that's where I have inserted the code |
Either way |
this also checks off following from issue #6
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @M-ZubairAhmed and thank you for this PR! 🎉
Left a few comments here and there. I think you broke the prompt.
Also, could you keep your PR focused on #71 and avoid changing other issues related stuff? It would be easier to review and accept smaller contributions.
Last commit for example, should be reverted.
src/contributors/__tests__/prompt.js
Outdated
const contributions = '' | ||
expect(() => prompt(options, username, contributions)).toThrow( | ||
`No contribution type found in the input. Did you forget to include them in the add command?`, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok let us handle this in another pr then
README.md
Outdated
- [Configuration](#configuration) | ||
- [Inspiration](#inspiration) | ||
- [Other Solutions](#other-solutions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be dealt with in another PR.
README.md
Outdated
@@ -167,13 +168,11 @@ Thanks goes to these wonderful people | |||
([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): | |||
|
|||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you remove that space by hand, or did the command output change? 🤔
i have reverted all the change to unwanted files |
currently the toc is being generated when i commit a readme file automatically |
I have added my self as contributor in this #79 pr |
Thank you for the rollbacks :) Tested the new PR, I still see it breaking things: 🍺 ~/all-contributors-cli (master)*$ ./src/cli.js
? What do you want to do? Add a new contributor or add a new contribution type
Invalid contribution type/s entered Normally here, I would have been asked first for the login, then for the contributions types (with a nice selection interface). Your PR seems to force the user to give all arguments on the command line. (did you know about this?) |
I did not know about this as in the issue it was mentioned error has occured because of
So i tested the code with that command and did not look at the CLI. What would you like me to do? |
can you take a look at this now? Cli seems to be working. May be i am missing some edge cases of the usage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
any status on this :-) |
@M-ZubairAhmed busy week for me, I'll try to recheck this soon. |
hi, |
Hi, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one thing, other than that, this is great!
src/contributors/prompt.js
Outdated
)(userContributions) | ||
|
||
if (_.isEmpty(validUserContributions)) { | ||
throw new Error('Invalid contribution type(s) entered') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make the error include a comma-separated list of the invalid contribution types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean to say, have a list of valid contribution types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want them to be able to see which contribution type they entered which was invalid so they know not to enter that again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added please take a look 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks!
What:
Issue #71
Why:
Wrong contribution type being added to .all-contributorsrc despite the error
How:
prompt.js
utils
if user types
add foo code,bar,video
and if user types all wrong types then nothing will be added with an error (please tell me if this is what you are looking for)?
Checklist: