Skip to content

fix: Fixing issues with commands introduced in #403#440

Open
jdalrymple wants to merge 2 commits intoall-contributors:mainfrom
jdalrymple:fix/address-errors-in-add-command
Open

fix: Fixing issues with commands introduced in #403#440
jdalrymple wants to merge 2 commits intoall-contributors:mainfrom
jdalrymple:fix/address-errors-in-add-command

Conversation

@jdalrymple
Copy link
Contributor

@jdalrymple jdalrymple commented Feb 14, 2026

What: A few issues with the commands were introduced by #403 whereby the config was not loaded where it should have been on the execution of the cli commands.

In addition to fixing this problem, I also:

  1. Cleaned up redundant config loads: Removed duplicate readConfig calls from checkContributors and commit functions
  2. Replaced chalk with yoctocolors: I was seeing some issues with the call to the Chalk.bold function, and since we only use bold and yellow, i looked for an alternative. Yocto is maintained by the same person, and its tiny tiny but perfect our usecase
  3. Improved CLI output formatting: Fixed inconsistent indentation and added proper spacing between sections

Why: Poor testing on my end

How:

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

Also replacing chalk with something lighter weight
@jdalrymple jdalrymple marked this pull request as ready for review February 14, 2026 20:32
const contributions = argv._[2]

// Add or update contributor in the config file
const data = updateContributors(argv, username, contributions)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Primary issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also another thing i missed in that original PR. I forgot the await here.

Copy link
Member

Choose a reason for hiding this comment

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

Ahh perfect. Justin, we can merge this FIRST, and then I'll rebase my tests pr against it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats what i was thinking!

const argv = getArgs()

// Load and merge config file data into argv
try {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Secondary issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tldr; Original PR removed the .config prop of the yargs method because the docs mentioned it didnt support async functions.

What i forgot to do apparently, it replace it properly, so the config wasnt loaded like it should have been. This change fixes that correctly by loading the config on execution of the cli command.

chalk.bold('Missing contributors in .all-contributorsrc:\n'),
YoctoColors.bold('Missing contributors in .all-contributorsrc:\n'),
)
process.stdout.write(` ${missingInConfig.join(', ')}\n`)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were indenting missing members, but not unknown members. It looked weird, so i removed the indent

Copy link
Member

@lwasser lwasser left a comment

Choose a reason for hiding this comment

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

@jdalrymple, everything here looks good to me, and it runs locally 🎉 🎉 You also simplified the configData /. argv load complexity, which works well, and the config params load locally as expected!
Because we are introducing a different dependency, I just want @JoshuaKGoldberg to have a look, but the CLI runs great with this pr.

@lwasser
Copy link
Member

lwasser commented Feb 14, 2026

@all-contributors please add @jdalrymple code, bug

@allcontributors
Copy link
Contributor

@lwasser

@jdalrymple already contributed before to code, bug

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.

2 participants