ament / ament/ament_lint

[ament_copyright] does not check LICENSE or CONTRIBUTING.md when package not at root

Aberta
#395 5 comentários 0 reações 1 responsável Reivindicada por @methylDragon Ver no GitHub
Linguagem predominante
Python
Estrelas
50
Forks
129
Merge médio
3d 10h
PRs com merge (30d)
3

Descrição

`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.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.