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

Improve 'expected a versioning field' error message #880

Merged
merged 5 commits into from
Feb 13, 2023

Conversation

Pospelove
Copy link
Contributor

@Pospelove Pospelove commented Feb 1, 2023

Imagine you try to commit a port with missing or invalid version field in manifest. You'd get an error like this:

error: can't load port wasmedge
error: while loading /Users/leonidpospelov/projects/vcpkg/ports/wasmedge/vcpkg.json:
$ (a manifest): unexpected field 'version-sever', did you mean 'version-semver'?
$ (a manifest): expected a versioning field (example: version-string) 

However it seems that using of version-string is deprecated:

Use the version scheme "version" instead of "version-string" in port "wasmedge".
Use --skip-version-format-check to disable this check.

This PR makes error message consistent with lint warnings and shows all version-like fields available:

Before:

$ (a manifest): expected a versioning field (example: version-string) 

After:

$ (a manifest): expected a versioning field (one of 'version', 'version-semver', 'version-date') 

@Pospelove Pospelove marked this pull request as draft February 1, 2023 10:57
@Pospelove Pospelove force-pushed the expected-a-versioning-field branch from 4409add to e381a9e Compare February 1, 2023 11:03
@Pospelove Pospelove marked this pull request as ready for review February 1, 2023 11:03
@ras0219-msft
Copy link
Contributor

ras0219-msft commented Feb 2, 2023

Thanks for the PR!

version-string is not deprecated -- however version, version-date, and version-semver provide a better experience for users and should be preferred IF the port's version matches those schemas. The message you saw (Use the version scheme "version" instead of "version-string" in port "wasmedge".) is only displayed when the version text matches the "version" schema.

@Pospelove
Copy link
Contributor Author

@ras0219-msft I see. Thanks for your explanation! Should this PR be closed then or is it still valid?

@BillyONeal
Copy link
Member

@ras0219-msft I see. Thanks for your explanation! Should this PR be closed then or is it still valid?

I think this is valid but we need to add version-string to the list.

Also somehow we missed localizing this :(

@BillyONeal BillyONeal merged commit e701024 into microsoft:main Feb 13, 2023
@BillyONeal
Copy link
Member

Thanks!

@Pospelove Pospelove deleted the expected-a-versioning-field branch February 14, 2023 00:00
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.

3 participants