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

CLI arguments validation for single values that are overwritten #146

Closed
BioPhoton opened this issue Oct 24, 2023 · 0 comments · Fixed by #164
Closed

CLI arguments validation for single values that are overwritten #146

BioPhoton opened this issue Oct 24, 2023 · 0 comments · Fixed by #164
Assignees
Labels
🐛 bug something isn't working 🧩 cli

Comments

@BioPhoton
Copy link
Collaborator

If we use the same parameter multiple times yargs turns them into an array.

npx code-pushup --format=md --config=stdout turns the args into {format: ['md', 'stdout']}

This is wanted behaviour as forms is an array already.

In cases where we would need to overwrite CLI args that are no arrays this in introducing a wrong data structure.

npx code-pushup --config=./config.a.ts --config=./config.b.ts turns the args into {config: ['config.a.ts', 'config.b.ts']}

We should implement a check in the config middleware to take the last value only of the wrong array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug something isn't working 🧩 cli
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants