I have the following spotless configuration:
spotless {
scala {
scalafmt()
licenseHeader('// Copyright (C) $YEAR ', 'package ')
}
}
Version is:
plugins {
id "com.diffplug.gradle.spotless" version "3.16.0"
}
however, the generated output is still 2018 and 2019. What is causing this mixup? how can I fix it?
For existing well-formed license headers the year is not changed:
https://github.com/diffplug/spotless/tree/master/plugin-gradle#license-header-options
so it's possible to end up with multiple years in the same code base.
If you want always a specific year you can set it in the license (e.g. hardcode it or get the current year programmatically) instead of using the year token.
You should checkout our new ratchetFrom 'origin/master' feature.
Most helpful comment
For existing well-formed license headers the year is not changed:
https://github.com/diffplug/spotless/tree/master/plugin-gradle#license-header-options
so it's possible to end up with multiple years in the same code base.
If you want always a specific year you can set it in the license (e.g. hardcode it or get the current year programmatically) instead of using the year token.