If a user has defined a specific git log format (pretty, etc.) in .gitconfig, the date may not be displayed.
The LicenseHeaderStep.java cannot then parse the date and throws an error:
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:3.4.0:apply (default) on project ...: There were 1 lint error(s), they must be fixed or suppressed.
[ERROR] src/main/java/.....java:LINE_UNDEFINED com.diffplug.spotless.generic.LicenseHeaderStep(java.lang.IllegalArgumentException) Unable to parse date from command 'git log --follow --find-renames=40% --reverse -- C:\..\..\.....java': (...)
[ERROR] Resolve these lints or suppress with `<lintSuppressions>`
To make parsing more robust with respect to user configurations, it would be better if the git log command specified the format it expects rather than relying on what the user has configured.
Example: git log --date=format:‘%Y’ --format=%cd
If a user has defined a specific git log format (pretty, etc.) in .gitconfig, the date may not be displayed.
The LicenseHeaderStep.java cannot then parse the date and throws an error:
To make parsing more robust with respect to user configurations, it would be better if the
git logcommand specified the format it expects rather than relying on what the user has configured.Example:
git log --date=format:‘%Y’ --format=%cd