-
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
Allow excluding checkers from ament_lint_auto #133
Conversation
ament_lint_auto/cmake/ament_lint_auto_find_test_dependencies.cmake
Outdated
Show resolved
Hide resolved
ament_lint_auto/cmake/ament_lint_auto_find_test_dependencies.cmake
Outdated
Show resolved
Hide resolved
df3e370
to
34b4536
Compare
- This is an example of ament/ament_lint#133 Signed-off-by: Juan Pablo Samper <jp.samper@apex.ai>
@dirk-thomas I think I've addressed all your comments. I have created the following PR (ament/ament_index#31) as an example of using the argument |
I don't think the current approach with the global flag works well in a kind of scenarios. E.g. a package finds on of the linters before (when the new global flag isn't set yet). How about just storing the excluded linter names in a global variable and instead of blindly triggering the extension point with |
@dirk-thomas Are you suggesting that we replace the call to the contents of OR to modify |
Copying the logic is not great. Also making this function rely on global state doesn't seem nice. How about adding an optional keyword argument to |
@dirk-thomas The issue with relying on |
If a certain linter is being excluded it shouldn't define any test so I don't see why the test should be registered in that case? Also each CMake function adding a linter test has a |
34b4536
to
d255295
Compare
@dirk-thomas I've pushed a new proposed solution based on our discussions above. This requires changes to I have tested it with our own packages, but I don't seem to find a good package in ros2 to show this working. What would be the best way to provide an example? |
|
@dirk-thomas Sounds good. See ros/class_loader#123 |
ament_lint_auto/cmake/ament_lint_auto_find_test_dependencies.cmake
Outdated
Show resolved
Hide resolved
ament_lint_auto/cmake/ament_lint_auto_find_test_dependencies.cmake
Outdated
Show resolved
Hide resolved
ament_lint_auto/cmake/ament_lint_auto_find_test_dependencies.cmake
Outdated
Show resolved
Hide resolved
ament_lint_auto/cmake/ament_lint_auto_find_test_dependencies.cmake
Outdated
Show resolved
Hide resolved
d255295
to
25fc618
Compare
@dirk-thomas This is ready for a review |
ament_lint_auto/cmake/ament_lint_auto_find_test_dependencies.cmake
Outdated
Show resolved
Hide resolved
Signed-off-by: Juan Pablo Samper <jp.samper@apex.ai>
25fc618
to
3ad1f2e
Compare
@dirk-thomas One last review, hopefully 😄 |
All good 👍 Thanks for iterating on it. |
I added a version dependency for this since the new argument is only available as of version 0.7.0: 8b6c495 |
- This serves as an example for the EXCLUDE option of ament_lint_auto_find_test_dependencies, allowing to exclude the default ament_copyright configuration and running with a custom configuration - See ament/ament_lint#133 and ament/ament_cmake#165
This PR implements the enhancement proposed in #132. It consists of two commits:
ament_lint_auto_find_test_dependencies
detected unused argumentsament_execute_extension
How to test
rclcpp
which usesament_lint_auto_find_test_dependencies
(https://github.com/ros2/rclcpp/blob/master/rclcpp/CMakeLists.txt#L140) :Introduce a couple of style error in a source file, run
colcon build
,colcon test --packages-select rclcpp
and see that thecpplint
anduncrustify
tests failExclude one of the checkers:
colcon build --packages-select rclcpp
,colcon test --packages-select rclcpp
and see that the uncrustify test does not exist any moreament_cmake_uncrustify
check explicitly, excluding the file with the style errors:uncrustify
should succeedament_cmake_cpplint
cpplint
test does not exist anymorecpplint
test (beforeament_lint_auto
), but use theFILTERS
option to suppress the error message:cpplint
test succeeds