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

Never print directly from deserialization code #594

Merged

Conversation

ras0219-msft
Copy link
Contributor

SPDX license parsing warnings were being emitted directly to stdout during manifest deserialization. We should never do this.

Drive-by fixes:

  1. I've added a missing trailing newline as part of print_error_message().
  2. Added detection of error: as another valid "error" message.

New behavior:

$ vcpkg format-manifest vcpkg.json
/workspaces/vcpkg-tool/vcpkg.json: $.license (an SPDX license expression): warning: Unknown license identifier 'hello'. Known values are listed at https://spdx.org/licenses/
    on expression: hello
                   ^
Failed to parse manifest file: /workspaces/vcpkg-tool/vcpkg.json
error: while loading /workspaces/vcpkg-tool/vcpkg.json:
$ (a manifest): missing required field 'name' (an identifier)
$ (a manifest): expected a versioning field (example: version-string)

@ras0219-msft ras0219-msft marked this pull request as ready for review June 21, 2022 15:49
@BillyONeal
Copy link
Member

I like this. Would you willing to add BillyONeal@2975acd ?

@ras0219-msft
Copy link
Contributor Author

Pushed

@BillyONeal BillyONeal merged commit a8bd864 into microsoft:main Jun 23, 2022
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