Warn by default on unrecognized elements #1096
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎉 New feature
Addresses the concern motivating #1035
Summary
It is common practice to add elements to a released version of the SDFormat spec without any changes to the spec version number. This results in different versions of the SDFormat specification being embedded in different versions of
libsdformat
. For example,//material/shininess
was added to SDFormat 1.7 in libsdformat 9.8.0 and to 1.7-1.9 in libsdformat 12.5.0, but the tag is not recognized by libsdformat 12.4.0. I think this can lead to significant user confusion, especially if model and world files begin to proliferate that use elements that aren't recognized by a version of libsdformat shipped with Ubuntu that does not receive feature updates.I have been brainstorming how to address this concern by adding patch numbers to the SDFormat specification in #1035, but it's a bit complicated. I think an easier intermediate step would be to generate warnings by default when unrecognized elements are found by the parser, which is what this pull request does.
Test it
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.