-
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
[ament_copyright] Fix file exclusion behavior #327
[ament_copyright] Fix file exclusion behavior #327
Conversation
This commit fixes the faulty file exclusion behavior reported in ament#326. Specifically, the exclusion list is matched against traversed files in the `crawler` module. Changes inspired by ament#299. Signed-off-by: Abrar Rahman Protyasha <[email protected]>
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 <[email protected]>
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 |
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 good with green CI.
It would also be nice to add a test for this.
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 <[email protected]>
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 <[email protected]>
@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. |
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 good, thanks for adding tests. It would probably be good to run CI so that these new tests run, in addition to the linters.
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 <[email protected]>
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 <[email protected]>
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. |
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 <[email protected]>
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 <[email protected]>
* [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 <[email protected]> * [ament_uncrustify] Add file exclusion tests Signed-off-by: Abrar Rahman Protyasha <[email protected]> * [ament_uncrustify] Remove erroneous pytest marker Signed-off-by: Abrar Rahman Protyasha <[email protected]>
* [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 <[email protected]> * [ament_uncrustify] Add file exclusion tests Signed-off-by: Abrar Rahman Protyasha <[email protected]> * [ament_uncrustify] Remove erroneous pytest marker Signed-off-by: Abrar Rahman Protyasha <[email protected]>
This PR fixes the file exclusion behavior reported in
#326.
Specifically, the exclusion list is matched against traversed
files in the
crawler
module.Changes inspired by #299.
Signed-off-by: Abrar Rahman Protyasha [email protected]