all-contributors/cli

Adding multiple contributions partially overrides a contributor's existing ones

JoshuaKGoldberg opened this issue · 3 comments

Describe the bug

If you add multiple ,-separated contributions with all-contributors add, then only some of the new contributions may be added. It's very odd.

This does not reproduce if you only add one contribution at a time.

To Reproduce

See https://github.com/JoshuaKGoldberg/repros/tree/all-contributors-multiple.

git clone -b all-contributors-multiple https://github.com/JoshuaKGoldberg/repros
cd repros
npm i

Adding a single contribution for a contributor successfully adds them to .all-contributorsrc:

npx all-contributors add joshuakgoldberg content
"contributions": [
  "bug",
+  "content"
]

But, adding multiple contributions partially overrides any existing contributions:

npx all-contributors add joshuakgoldberg docs,example
"contributions": [
  "bug",
+  "example"
]

...and then running the same command again ends up with just "example" listed (?!):

"contributions": [
-  "bug",
+  "example"
]

Expected behavior

Adding new contributors should exclusively add, not take away.

Is that happening with any particular version? I wonder if it's a regression.

Hmm, now I can't repro it. Also maybe it's that I was typoing and using docs instead of doc? Will close - thanks!

That's possible (especially since the bot will know what you mean but not the CLI).