Skip to content
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

How to annodate all files in a directory #817

Closed
fhg-isi opened this issue Aug 4, 2023 · 3 comments
Closed

How to annodate all files in a directory #817

fhg-isi opened this issue Aug 4, 2023 · 3 comments

Comments

@fhg-isi
Copy link

fhg-isi commented Aug 4, 2023

I tried to use the annotate option with the current directory:

reuse annotate --copyright="Foo" --copyright-style=string-symbol --license=AGPL-3.0-or-later .

However, it only seems to support single files.

=> How can I apply it recursively for a whole directory?

@fhg-isi
Copy link
Author

fhg-isi commented Aug 4, 2023

As a workaround, something like

find . -type f -exec reuse annotate --copyright="Foo" --copyright-style=string-symbol --license=AGPL-3.0-or-later {} \;

might do the trick. However, that won't work with the GitHub action

https://github.com/fsfe/reuse-action

@fhg-isi
Copy link
Author

fhg-isi commented Aug 4, 2023

The --recursive and --skip-unrecognised options help with that:

reuse annotate --copyright="Foo" --copyright-style=string-symbol --license=AGPL-3.0-or-later --recursive --skip-unrecognised .

Maybe you want to include that in the documentation at

https://reuse.readthedocs.io/en/latest/usage.html

Further note:

I got an error

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

and resolved this by adding the .idea folder to my .gitignore list.

In some cases it could be helpful to be able to exclude folders from the recursion.
Related: #804

@fhg-isi fhg-isi closed this as completed Aug 4, 2023
@johann-wurz
Copy link

johann-wurz commented Jan 30, 2024

The --recursive and --skip-unrecognised options help with that:

reuse annotate --copyright="Foo" --copyright-style=string-symbol --license=AGPL-3.0-or-later --recursive --skip-unrecognised .

Unfortunately, this does not work. The --recursive passphrase didn't do anything in my case. Using the above workaround applying find works properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants