-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add an EnforcementPolicy for deprecated elements #543
Conversation
This can be used to configure whether the parser will emit a warning or an error when encountering a deprecated element. Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! This would be super useful moving forwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just some minor nits, not acutely aligned w/ aim of this PR, so feel free to ignore 'em!
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
109dd41
to
eebf49b
Compare
I believe I've addressed all the feedback. @EricCousineau-TRI , PTAL. |
All of this looks great, thanks! |
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
🎉 New feature
Closes #541
Summary
If the warning policy of the parser is set to
ERR
in thesdf::ParserConfig
, the parser emits an error message for deprecated elements. This PR adds a separateEnforcementPolicy
for deprecated elements so that the behavior of the parser can be configured by the user. The API is such, by defaultDeprecatedElementsPolicy
reflects the value ofWarninPolicy
, but the user can callSetDeprecatedElementsPolicy
to override the value. Note that the order of the function calls does not matter. Once theDeprecatedElementsPolicy
overridden, callingWarninPolicy
will not change the value ofDeprecatedElementsPolicy
unlessResetDeprecatedElementsPolicy
is called. I'm open to feedback on this API.Test it
Tests are in
test/integration/deprecated_specs.cc
Checklist
sh tools/code_check.sh
)another open pull request
to support the maintainers
Note to maintainers: Remember to use Squash-Merge
🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸