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

Add configuration to disable unused license warnings #285

Merged
merged 4 commits into from
Jan 16, 2024
Merged

Add configuration to disable unused license warnings #285

merged 4 commits into from
Jan 16, 2024

Conversation

jonapoul
Copy link
Contributor

@jonapoul jonapoul commented Jan 12, 2024

I put this together because I had a similar use case to some of the people in #134. Basically we have a list of allowed licenses in our organisation, so in our case it doesn't make sense to have a log full of warnings when there's no problem to flag up. Much simpler to configure the project with the licenses that we can use, then only get notified of any violations of that list.

Core of the change is a new method to the LicenseeExtension:

licensee {
  unusedAction(UnusedAction.IGNORE) // or WARN
}

where the default is UnusedAction.WARN. Most of the diffs are test fixtures, I haven't done a whole lot of Gradle plugin tests before so let me know whether these are decent.

Copy link
Collaborator

@JakeWharton JakeWharton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nicely done! Just one small naming nit.

src/main/kotlin/app/cash/licensee/pluginExtension.kt Outdated Show resolved Hide resolved
@jonapoul
Copy link
Contributor Author

Just tried running the build on my fork, seems to be setting up Java okay: https://github.com/jonapoul/licensee/actions/runs/7547641594
Not sure why it's failing here...

@JakeWharton
Copy link
Collaborator

Yeah I retried a few times already. I'll try again later.

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

Successfully merging this pull request may close these issues.

2 participants