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

Feature Request: Add configuration to disable unused spdx-identifier, license-url and dependency warnings #134

Closed
mervyn-mccreight opened this issue Nov 11, 2022 · 6 comments

Comments

@mervyn-mccreight
Copy link

mervyn-mccreight commented Nov 11, 2022

Imagine one wants to provide a centralized configuration of allowed libraries open for everyone to use.
It would be nice to have the ability to disable the warnings, otherwise one might get spammed with the warnings, because a centralized catalogue might most possibly cover more licenses than you actually use.

@JakeWharton
Copy link
Collaborator

Makes sense!

@mervyn-mccreight
Copy link
Author

mervyn-mccreight commented Nov 11, 2022

Thanks for your quick reply!
I prepared a PR for this feature, looking forward to your feedback on it.

@hfhbd
Copy link
Contributor

hfhbd commented Mar 11, 2023

I don't see the use case without applying the plugin to the root project which is discouraged and should be prevented in upcoming Gradle releases. Instead, use convention plugins and apply the plugin for each project. This also allows you to allow some base spdx licenses and allow individual licenses at project level.

@paulchen
Copy link

I don't see the use case without applying the plugin to the root project which is discouraged and should be prevented in upcoming Gradle releases. Instead, use convention plugins and apply the plugin for each project. This also allows you to allow some base spdx licenses and allow individual licenses at project level.

Suppose you have a project consisting of ten subprojects. There is a convention plugin enabling the licensee plugin. This convention plugin is used in all subprojects. All but one subproject have a dependency to a library that is licensed under the MIT license.

Now there are two possibilities to allow dependencies to the MIT-licensed library:

  • Allow the MIT license in all subprojects that depend on the library. Changes to nine different files are necessary.
  • Allow the MIT license in the convention plugin. Only one file needs to be changed.

While I don't see a reason why one should not go for the second option, a warning will be generated for the submodule that does not have the dependency to the MIT-licensed library.

@mervyn-mccreight
Copy link
Author

Another use case could be when you work in an environment where you have a global allowed set of allowed open source licenses.

You could write a convenience plugin then in which you use this plugin and configure it to allow this specific set of licenses. That would be a one timer and the only reason to change something in this convenience plugin would be if the set of allowed licenses changes.

You could then use this plugin in all of your projects.

But going forward like this, one would possibly get a lot of warnings because of unused but allowed licenses.

@jonapoul
Copy link
Contributor

jonapoul commented Jan 19, 2024

In case anyone's still interested, a PR's been merged to support this: #285

Comes with a new config option:

licensee {
  unusedAction(UnusedAction.IGNORE) // defaults to WARN
}

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