-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add configuration for addheader and provide --defaults for addheader #68
Comments
Additionally, make it possible to configure a default template for a given template. |
@carmenbianca @siiptuo @CharString @mxmehl I really like to see this feature become a reality, and at the moment there are already 2 good PR's to read copyright information from the project: #240 and #345 As these two are already in conflict, as they both add a single side-step to the explicit arguments, I think we need to discuss how this should be implemented. Also considering that in line with the Use-caseCurrently with version 0.13 the init prompt is the following $ reuse init
Initializing project for REUSE.
What license is your project under? Provide the SPDX License Identifier.
To stop adding licenses, hit RETURN.
GPL-3.0-or-later
What other license is your project under? Provide the SPDX License Identifier.
To stop adding licenses, hit RETURN.
What is the name of the project?
myproject
What is the internet address of the project?
https://....org
What is the name of the maintainer?
Best Maintainer
What is the e-mail address of the maintainer?
thebest@maintainer.org
All done! Initializing now.
Downloading GPL-3.0-or-later
LICENSES/GPL-3.0-or-later.txt already exists
Creating .reuse/dep5
Initialization complete. I think we can make it something like: $ reuse init
Initializing project for REUSE.
# A license was found in the pyproject.toml and translated to the SPDX identifier.
What license is your project under? GPL-3.0-or-later was found in pyproject.toml would you like to add it? [Y/n]
Y
# As this is a multiple-input, the user is prompted for additions
What other license is your project under? Provide the SPDX License Identifier.
To stop adding licenses, hit RETURN.
# Again an existing option is found, this time only a single answer is desired.
What is the name of the project? The name 'default-template' was found in pyproject.toml. Would you like to use it? [Y/n]
n
# As the suggestion is not used, the original prompt is shown
What is the name of the project?
myproject
# No internet address was found, so a regular prompt is shown
What is the internet address of the project?
https://....org
# Many options were found on different location, the user can select
What is the name of the maintainer? Several names were found. Would you like to use any of those? Press the according number and hit RETURN or type [n] to fill one in yourself.
[1] BestMaintainerGitHub
from repository git settings
[2] laptop-user
from global git settings
[3] Best Maintainer
from pyproject.toml author
[4] Best Maintainer
from pyproject.toml maintainers
[5] Best Maintainer friend
from pyproject.toml maintainers
4
# Example to auto-complete the email after the username was selected from a particular source. This might be too complicated with little benefit.
What is the e-mail address of the maintainer? Several addresses were found. The previously selected user came with the email address 'best.maintainer@work.com'. Would you like to use it? [Y/n]
n
# Back to the prompt for multiple options.
What is the e-mail address of the maintainer? Several addresses were found. Would you like to use any of those? Press the according number and hit RETURN or type [n] to fill one in yourself.
[1] bestmaintainer+github@maintainer.org
from repository git settings
[2] laptop-user@localhost
from global git settings
[3] info@maintainer.org
from pyproject.toml author
[4] best.maintainer@work.com
from pyproject.toml maintainers
[5] good.maintainer@friend.org
from pyproject.toml maintainers
n
# And finally back to the original prompt because no suggestion is used
What is the e-mail address of the maintainer?
thebest@maintainer.org
All done! Initializing now.
Downloading GPL-3.0-or-later
LICENSES/GPL-3.0-or-later.txt already exists
Creating .reuse/dep5
Creating .reuse/config #NOTE: also saving it for later
Initialization complete. So the idea is to gather all available information and use it to help the user in filling in the information. Perhaps my example is a bit verbose, but I did it to show some edge-cases and get some discussion going. ImplementationA modular approach is needed to enable additional sources of information in the future. Also they might be used in different stages than init. So for every source of truth a function or file can be created, say A generic function could trigger these truth finding functions, like When calling Further ideas
Next stepsThis approach would mean that the current PR's would be moved to a separate location in the source so both can provide information to the init function. The rewrite of the prompt is work that needs to be done from scratch. We can start there and work on improving the init at a later stage. What do you think? Also I hope you can suggest a proper name for this feature in the source code. I was thinking something like "truth" or "config". Edit: PR #349 to determine the copyright year could be integrated in a similar way. |
Thanks a lot for sharing your thoughts here! Your modular approach and integration in
To be frank, both don't really convince me:
I imagined that to be a one-shot conversion. SPDX files are often not inside a repo permanently, but rather generated on shipping a package. The workflow I'd imagine for this is:
|
@nicorikken This pretty much describes the workflow I expect from using a tool like reuse; it removes the tedium wherever it can, by discovering educated defaults that I can confirm or deviate from. In the end I, as the user, am still legally bound by what the tool does for me, so in a way it should function like a legal clerk... The rest is just implementation ;-) |
In a hackathon we are just running we concluded to do the following:
|
Now that scripts are part of the documentation I think most of this discussion can be ignored and mostly the idea of a |
Nice to see this! I had added #707 for the default settings flow that I liked to have when I thought about it. This might be interested in this issue:
|
See also #13.
git config
and.reuse/config
should provide default values for author/email and default license respectively.It makes sense for me to implement this as a composite of Project. This might be a little difficult, though, because I'd have to forward the config object to a lot of places that do not currently have one.
The text was updated successfully, but these errors were encountered: