Skip to content

License header with changing section #2564

Closed Answered by nedtwigg
fwendland asked this question in Q&A
Discussion options

You must be logged in to vote

You can do something like:

spotless {
  toggleOffOn(' * Contributors:\n', ' */\n')
  // this might work better, it's more specific
  toggleOffOn(' * Contributors:\n', ' */\n\n// SPDX-License-Identifier: Apache-2.0')
}

This is the code in the Gradle plugin, maven has equivalents

public void toggleOffOnRegex(String regex) {
this.toggleFence = FenceStep.named(FenceStep.defaultToggleName()).regex(regex);
}
/** Disables formatting between the given tags. */
public void toggleOffOn(String off, String on) {
this.toggleFence = FenceStep.named(

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fwendland
Comment options

Answer selected by fwendland
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants