-
Notifications
You must be signed in to change notification settings - Fork 122
(cmake_xmllint) make extensions configurable #479
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
base: rolling
Are you sure you want to change the base?
Conversation
|
Friendly ping @clalancette |
1 similar comment
|
Friendly ping @clalancette |
|
CI Issues are related to https://bugs.launchpad.net/ubuntu/+source/python-flake8/+bug/2012523 |
| # | ||
| function(ament_xmllint) | ||
| cmake_parse_arguments(ARG "" "MAX_LINE_LENGTH;TESTNAME" "" ${ARGN}) | ||
| cmake_parse_arguments(ARG "" "TESTNAME" "PATHS;EXCLUDE;EXTENSIONS" ${ARGN}) |
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.
It doesn't look like either PATHS nor EXCLUDE are being used here, so let's just drop them.
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.
I will check whether I want to add these as well or remove them.
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.
I have update the macro to also use the PATHS and EXCLUDE args. (Though these are not use in the ament_lint_auto hook. As it looks for files, which eventually will be used by ament_xmllint. But then you are recreating the logic from ament_xmllint in CMake, which is undesired. But I don't think you want to call the python function from the ament_xmllint library here.
|
|
||
| file(GLOB_RECURSE _source_files FOLLOW_SYMLINKS "*.xml") | ||
| # Forces ament_xmllint to consider ament_cmake_xmllint_EXTENSIONS as the given extensions if defined | ||
| set(_extensions "xml") |
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.
This feels a little weird. If the user doesn't specify anything for EXTENSIONS, then we won't pass --extensions to ament_xmllint at all, and then that script will choose the xml extension itself. If the user specifies some EXTENSIONS, then we will always pass --extensions xml, plus whatever they choose. There is no way for the user to ask for extensions that doesn't include xml.
I think we should do one of two things here:
- If the user specifies EXTENSIONS, then make that the complete set. Don't silently add
.xml. - Rename the variable from EXTENSIONS to EXTENSIONS_APPEND or something like that, to make it clear that we will always do at least xml.
Either way, we should document what we are doing in the documentation to ament_xmllint.
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.
No, I checked the behaviour. When setting ament_cmake_xmllint_EXTENSIONS, it will completely overwrite the _extensions variable. As I use REGEX REPLACE.
|
@clalancette friendly ping ;) |
1 similar comment
|
@clalancette friendly ping ;) |
Signed-off-by: Matthijs van der Burgh <[email protected]>
Signed-off-by: Matthijs van der Burgh <[email protected]>
Signed-off-by: Matthijs van der Burgh <[email protected]>
97676f8 to
c31de83
Compare
|
@clalancette I have updated the branch to be aligned with the upstream repo. Please have a look at the MR. |
|
@sloretz or @clalancette do you mind to take a look ? |
Make it possible to configure the file extensions to be checked by xmllint from CMake.
This can be done by setting the
ament_cmake_xmllint_EXTENSIONSas a space or comma separated string of extensions when usingament_lint_auto. Or by passing theEXTENSIONStoament_xmllintfunction directly.