fsfe / reuse-tool

reuse is a tool for compliance with the REUSE recommendations.
https://reuse.software
402 stars 148 forks source link

Certain glob patterns matching folders in the README.toml do not work #1071

Closed brlin-tw closed 1 month ago

brlin-tw commented 1 month ago

The following project filetree:

.
├── folder-1
│   └── README.md
├── LICENSES
│   └── WTFPL.txt
├── README.md
└── REUSE.toml

with the following REUSE.toml rules:

version = 1

[[annotations]]
path = [
    "README.md"
]
SPDX-FileCopyrightText = '2024 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>'
SPDX-License-Identifier = 'WTFPL'

[[annotations]]
path = [
    "folder-*/README.md"
]
SPDX-FileCopyrightText = '2024 林博仁(Buo-ren Lin) <buo.ren.lin@gmail.com>'
SPDX-License-Identifier = 'WTFPL'

resulted in the following REUSE tool lint error:

# MISSING COPYRIGHT AND LICENSING INFORMATION

The following files have no copyright and licensing information:
* folder-1/README.md

Refer to https://gitlab.com/brlin/reuse-tool-not-able-to-match-folder-glob-problem for the problem reproducer.

Known workaround

Replace the single asterisk in the filename pattern to double asterisks works, somehow:

[[annotations]]
path = [
    "folder-**/README.md"
]
carmenbianca commented 1 month ago

Interesting bug, thank you @brlin-tw !