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

change msg when missing = in key=value #2350

Merged

Conversation

KorenBenEzri
Copy link
Contributor

What does this PR do?

This PR changes the error message when the user supplies --project-tags=THING : instead of getting the error:
The tag "XXX" does not have an "=" separating the key and value.
User will now get the error:
The tag "XXX" does not have an "=" separating the key and value. eg: --project-tag=KEY=VALUE

https://github.com/snyk/snyk/blob/afe15c7fad3baddb8958bcdc979894aba5bf30b8/src/cli/commands/monitor/index.ts#L429

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2021

Warnings
⚠️ You've modified files in src/ directory, but haven't updated anything in test folder. Is there something that could be tested?
⚠️

Since the CLI is unifying on a standard and improved tooling, we're starting to migrate old-style imports and exports to ES6 ones.
A file you've modified is using either module.exports or require(). If you can, please update them to ES6 import syntax and export syntax.
Files found:

  • src/cli/commands/monitor/index.ts
Messages
📖

This PR will not trigger a new version. It doesn't include any commit message with feat or fix.

Generated by 🚫 dangerJS against 8b479b9

Copy link
Contributor

@JackuB JackuB left a comment

Choose a reason for hiding this comment

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

Pre-approving, but just update the commit and error messages 👌

@@ -426,7 +426,7 @@ export function generateTags(options): Tag[] | undefined {
const parts = keyEqualsValue.split('=');
if (parts.length !== 2) {
throw new ValidationError(
`The tag "${keyEqualsValue}" does not have an "=" separating the key and value.`,
`The tag "${keyEqualsValue}" does not have an "=" separating the key and value. eg: --project-tag=KEY=VALUE`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`The tag "${keyEqualsValue}" does not have an "=" separating the key and value. eg: --project-tag=KEY=VALUE`,
`The tag "${keyEqualsValue}" does not have an "=" separating the key and value. E.g. --project-tag=KEY=VALUE`,

Or

Suggested change
`The tag "${keyEqualsValue}" does not have an "=" separating the key and value. eg: --project-tag=KEY=VALUE`,
`The tag "${keyEqualsValue}" does not have an "=" separating the key and value. For example --project-tag=KEY=VALUE`,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done 👍

@KorenBenEzri KorenBenEzri force-pushed the chore/tagging/project-tags-err-message-with-example branch 2 times, most recently from 5c7aee3 to edb2006 Compare November 9, 2021 12:13
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