-
Notifications
You must be signed in to change notification settings - Fork 157
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
Behaviour of reuse addheader
#13
Comments
Accidentally posted the issue before it was ready. I edited it to be complete now. The main questions, I think, are:
|
No, I guess not. But we could introduce some flag which makes it more interactive, so asks more often. Just like
You also run
As above, with an additional flag. Other than that, I would just be verbose about what the tool has done. Same for 7.
Erm... Being interactive, so outlining which sources the user has, and letting them choose one source, might be the most sensible option here...
You mean, if the holder and license conflicts with the env/reuse/git configs? I would give preference to the explicit options the user gave when running the tool, so in this case John Doe and CC0-1.0 |
I like adding an interactive flag. But then the default behaviour should never be interactive. Ergo:
This shouldn't happen unless the One good way to solve 8 is by documenting a very clear "order of operations":
And always verbosely confirming what the tool has done, of course. Perhaps even specify where a certain option comes from (e.g., "Sourcing 'Mary Sue' from the environment variable $NAME"; "Sourcing '0BSD' from 'default_license' in '.reuse/config'"). But with better wording.
Agreed. |
Oh, I should probably add: The more I'm pondering environment variables, the more I'm hesitant about it. The variable
|
Could you please explain why they don't conflict?
Good points. I would also prefer simplicity, so less options. However, having env variables would allow for some scripting cases. OTOH, one could easily do that with the command line options. Shall we drop it but keep it in mind if there is some well-reasoned request? |
+1 |
Are the discussed options already part of the current addheader function, or are there some cases missing? |
Most of it is not yet a part of the addheader function. I'm going to take a look at that today. |
The current behaviour is:
Will create a new issue for the not-implemented bits. |
This issue outlines all the ways in which one might use
reuse addheader
, and what should happen in those cases.1. Simplest case
This is a super straightforward case.
reuse addheader --copyright "Mary Sue" --license 0BSD myfile.py
should add the headerShould there be a confirmation prompt here?
2. Overwriting current year
Also a simple case.
reuse addheader --year 1984 --copyright "Mary Sue" --llicense 0BSD myfile.py
should add the header3. Chaining copyright holders and licenses
You can repeat arguments.
reuse addheader --copyright "Mary Sue" --copyright "John Doe" --license 0BSD --license MIT
should add the header4. No arguments
The thing prompts you, maybe? This might be super clumsy though.
Everything between brackets is user input.
5. Environment variables
Maybe we can set environment variables so that you don't have to be prompted. Kind of like a default setting for lazy users.
will add the header
Should the user be prompted to confirm this?
6. Config
Maybe we could put some defaults in
.reuse/config
. Let's say that that file looks like this:reuse addheader --copyright "Mary Sue" myfile.py
should add the headerShould the user be prompted to confirm this?
The default copyright holder CANNOT be in
.reuse/config
, because an individual's setting cannot be in the repository.7. Use git config
Maybe some defaults could be taken from
git config
. Given a.git/config
(or global gitconfig) like thisThen
reuse addheader --license 0BSD myfile.py
might add the headerShould the user be prompted for this?
8. All of the above
Given a
git config
like this:and environment variables like this:
and a
.reuse/config
like this:What happens if you type
reuse addheader myfile.py
?What happens if you type
reuse addheader --copyright "John Doe" --license "CC0-1.0" myfile.py
?The text was updated successfully, but these errors were encountered: