-
Notifications
You must be signed in to change notification settings - Fork 461
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
disable license rule for specific file #650
Comments
I think you're describing a relatively common usecase, which we don't support easily. There are a few corner cases, but I think the way to support it would be to look in this string for that "suppress" token, and then return early.
Happy to take a well-tested PR for this, it's a bit tricky because the license header step has a few different modes. In the meantime, there is a verbose workaround using multiple language-specific blocks, e.g.: spotless {
java {
targetExclude 'foo.java'
googleJavaFormat()
licenseHeader ...
}
format 'javaWithoutLicense', com.diffplug.gradle.spotless.JavaExtension, {
target 'foo.java'
googleJavaFormat()
// no licenseHeader
}
} |
well I tried licenseHeader because |
This isn't a good solution, but you can now disable spotless formatting with
Then if you replace the stuff inside of |
Published in plugin-gradle |
I have some code that has no license or code that is apache licence (like copied from a code sample).
I have also licence rule that add copyright to me, but I do not want to claim copyrights for those/
I tried
@file:Suppress("licenseHeader")
but it seems the license is still overwritten
The text was updated successfully, but these errors were encountered: