-
Notifications
You must be signed in to change notification settings - Fork 107
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 AMENT_LINT_AUTO_SKIP_PREEXISTING_TESTS flag #482
base: spaceros
Are you sure you want to change the base?
Conversation
3009e52
to
6de70bd
Compare
…). Signed-off-by: xfiderek <[email protected]>
6de70bd
to
4d95970
Compare
CC: @mjcarroll /assign |
I'm not sure I fully understand what you are trying to accomplish here. Can you expand a bit more on the use case and what you are trying to solve with this flag? |
Sure! So basically we want to add functionality to spaceros, that will allow users to overwrite linters defined in CMakeLists.txt files of upstream packages, to ensure that all ros packages are analysed with the same set of linters. One way to solve that would be to modify CMakeLists.txt files directly. What we plan to do instead is to inject cmake script during build process of upstream packages using CMAKE_PROJECT_INCLUDE variable. In that script, we would specify linters by using ament_lint_auto and calling find_package() on linters that we want to add (e.g. ament_cobra, ament_cppcheck). Lets now imagine that an upstream package already includes one of our linters, lets say ament_cppcheck. Prior to this PR, the build would fail because the same test would have been defined twice -> once in our script and once in original CMakeLists.txt. Hope it makes sense. Ive tried to find another approach that would allow us to achieve this functionality, but i couldnt really come up with simpler and cleaner altenrative that does not involve modifying cmakelists.txt files of upstream packages. |
Hey ament team, sorry for the bump - I fully recognize how taxing and thankless maintaining these low-level infrastructure packages can be - but this is blocking two other PRs which are now going to miss this quarter's space-ros release and leave our static analysis coverage compromised. Is there anything we can do to support you in progressing this review? |
Thanks. I'm clear on the use case now. Can you add an entry to the docs to describe the use of that variable. What you have stated here is sufficient for me, just to make sure it is documented. I would recommend here: https://github.com/ament/ament_lint/blob/rolling/ament_lint_auto/doc/index.rst |
Hi, sorry for the delay on my side. Thanks a lot for the review, I have uploaded the documentation as you suggested. Ideally we would update spaceros branch to include the latest changes to the ament repo, but we should probably handle that as a separate issue :). |
…pace-ros/space-ros#57). Signed-off-by: xfiderek <[email protected]>
675ec32
to
127ce1d
Compare
Hey @mjcarroll, could you take a look at my changes? |
@mjcarroll it's time for our next release, will you have time to take a look soon? |
Summary
Added a flag
AMENT_LINT_AUTO_SKIP_PREEXISTING_TESTS
to every test in the repo. If the flag is defined and set toON
, then already added tests (matched by name) are ignored. This is contrary to default behavior of ament_lint_auto, as by default duplicate test names cause build failure.The code is backward compatible -> added piece of code has no effect, unless the flag is set.
Use case
This flag helps to solve space-ros/space-ros#57. The main idea for resolution of that issue is to inject additional cmake script during build using CMAKE_PROJECT_INCLUDE variable, that will add linters to packages. Check linked issue and README in the PR for more details.