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

Replaces use of shellwords for parsing labels with custom parser #68

Merged
merged 2 commits into from
Oct 21, 2021

Conversation

dmikusa
Copy link
Contributor

@dmikusa dmikusa commented Oct 13, 2021

Summary

  • Removes use of shellwords
  • Parses key=value pairs out of the argument
  • Supports the use of quotes (single or double) in both key and value
  • Supports embedded quotes if they are escaped
  • Supports embedded equal signs in the value
  • Attempts to generate meaningful errors showing where the problem occurred

An alternative implementation to resolve #30

Use Cases

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@dmikusa dmikusa added type:bug A general bug semver:patch A change requiring a patch version bump labels Oct 13, 2021
@dmikusa dmikusa requested a review from a team as a code owner October 13, 2021 17:27
- Removes use of shellwords
- Parses key=value pairs out of the argument
- Supports the use of quotes (single or double) in both key and value
- Supports embedded quotes if they are escaped
- Supports embedded equal signs in the value
- Attempts to generate meaningful errors showing where the problem occurred

Signed-off-by: Daniel Mikusa <[email protected]>
- It will now error if you have characters after the end of a quoted string, i.e. `"key"bad=val` or `key="val"bad`
- It will now error if there is an empty key
- Fixed a minor bug with the calculation of the location of the error, it was not counting quotes properly before

Signed-off-by: Daniel Mikusa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump type:bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected characters must be quoted in BP_IMAGE_LABELS
1 participant