reuse-tool icon indicating copy to clipboard operation
reuse-tool copied to clipboard

`reuse annotate` doesn’t use `--style` if file extension isn’t recognised

Open Freso opened this issue 1 year ago • 1 comments

Test case

With reuse init already run and where "CC0-1.0" is one of the used licenses:

touch test.txt
reuse annotate --copyright "me!" --license CC0-1.0 --style python ./test.txt

Expected outcome

test.txt would have a Python style header indicating "me!" as the author and CC0-1.0 as the license.

Actual outcome

reuse annotate: error: The following files do not have a recognised file extension. Please use --style, --force-dot-license, --fallback-dot-license, or --skip-unrecognised:

test.txt

Nothing is written to test.txt

Enviroment

> reuse --version
reuse 3.0.1
> distro
Name: Arch Linux
Version: rolling (n/a)
Codename: n/a

Freso avatar Feb 21 '24 15:02 Freso

Oh, looks like this may be a partial duplicate of https://github.com/fsfe/reuse-tool/issues/902 and already have a fix waiting in https://github.com/fsfe/reuse-tool/pull/909 – curious that neither of those showed in my searches for previous reports. Ah well.

Not sure if you want to extract the first part of #902 into this one and then have #902 be only about Cargo.lock files, or if this one should just be closed as a duplicate.

Freso avatar Feb 22 '24 17:02 Freso