[ament_copyright] Fix file exclusion behavior#327
Conversation
Since file names are not indiscriminately matched throughout the search tree anymore, the excluded files listed in the copyright tests need to be updated relative to the root of the package. Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
f9f7e56 to
b10782d
Compare
|
Note that wildcard patterns are supported following this PR, because of the nature of |
|
For reviewers: note that the Rpr job failed for the initial commit (f9f7e56) because copyright tests in some other lint packages could not exclude files like before - i.e. I recognize that this is not ideal, and maybe the desired behavior is for |
Thanks for the review! I will do that shortly. |
Specifically, these tests check for: - Incorrect exclusion of single filenames. - Correct exclusion of relatively/absolutely addressed filenames. - Correct exclusion of wildcarded paths. Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
These unit tests make sure both search and exclusion behaviors are correctly demonstrated by the `ament_copyright.crawler` module. Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
|
@audrow I've added test cases to test file exclusion in cbed0b9 and added unit tests for the crawler module - these tests for thoroughly testing the search/exclusion behavior - in 5a6177a. I recognize that this PR is super long now! My bad. If you want, I can revert 5a6177a and submit that as a separate PR, as the script-level exclusion behavior |
|
For reviewers' benefit, here's a summary of the exclusion behavior after this PR. .
├── a.cpp
├── b.cpp
└── dir
├── a.cpp
└── b.cpp
Let me know if this is desired/good behavior for exclusion, particularly in regard to the last two points. I can easily see provision of a directory to mean "exclude all items in that directory (and all its subdirectories)". If so, I can amend that. |
|
Thanks for the review again @audrow. Yes, the last CI run did not invoke these tests, so let me run CI again. CI (build/test: |
This PR fixes the file exclusion behavior reported in Specifically, the exclusion list is matched against files/directories as the search path is traversed. Tries to maintain consistency with ament#327. Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
|
It seems that CI was being built with Here is another run of CI. |
|
Thank you for running CI correctly @audrow. It looks like there are some |
|
@aprotyas, CI is green! Do you have merge access? Otherwise, I can merge this in. |
|
@audrow Thanks for re-running CI (again)! I don't have merge access, so I'll ask you to merge this in. |
* [ament_uncrustify] Fix file exclusion behavior This PR fixes the file exclusion behavior reported in #326. Specifically, the exclusion list is matched against files/directories as the search path is traversed. Tries to maintain consistency with #327. Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu> * [ament_uncrustify] Add file exclusion tests Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu> * [ament_uncrustify] Remove erroneous pytest marker Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
* [ament_uncrustify] Fix file exclusion behavior This PR fixes the file exclusion behavior reported in ament#326. Specifically, the exclusion list is matched against files/directories as the search path is traversed. Tries to maintain consistency with ament#327. Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu> * [ament_uncrustify] Add file exclusion tests Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu> * [ament_uncrustify] Remove erroneous pytest marker Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
This PR fixes the file exclusion behavior reported in
#326.
Specifically, the exclusion list is matched against traversed
files in the
crawlermodule.Changes inspired by #299.
Signed-off-by: Abrar Rahman Protyasha aprotyas@u.rochester.edu