[ament_copyright] does not check LICENSE or CONTRIBUTING.md when package not at root
- Dominant language
- Python
- Stars
- 50
- Forks
- 129
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 3
Description
`ament_copyright` [crawls for files](https://github.com/ament/ament_lint/blob/c01b035957dda939e8cffd33f431d26bd83ce233/ament_copyright/ament_copyright/crawler.py#L22) recursing down from the initial paths supplied. Only if a path that it encounters while doing so is found to be the root of a repository does it check the existence and content of LICENSE and CONTRIBUTING.md.
This means that if a package is not immediately in the root of the repository and `ament_copyright` is called with the path of the package, then these files are not checked.
This is the situation when running `colcon test`, so this will not find any issues with these files. We ran into this where we had a repository with multiple packages and a CI pipeline that would run `colcon test` and failed to pick up an issue with these files.
A solution could be to crawl upwards until the repository root in case the license files have not been found in the downwards pass. If you reckon that that is a reasonable thing to do, then I am happy to prepare a PR for that.
Contributor guide
Assessment
This issue has not been assessed yet.