Spotless's `spotlessSetLicenseHeaderYearsFromGitHistory`: Unable to parse date from command
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- git, java
- Domain
- build-system, tooling
Research direction
Start at com.diffplug.spotless.generic.LicenseHeaderStep.parseYear, reported at LicenseHeaderStep.java:467, and reproduce with Gradle 8.4 using spotlessSetLicenseHeaderYearsFromGitHistory=true on Windows. Compare the reported git log command with and without --follow; done means the Spotless task completes and correctly determines the file's creation year.
Written by the indexing model from the issue text.
Description
If you are submitting a bug, please include the following:
- summary of problem
- Using the
-PspotlessSetLicenseHeaderYearsFromGitHistory=trueparameter to generate license headers with the creation year of the file, spotless fails to successful run the task
- Using the
- Gradle or Maven version
- Gradle 8.4
- Java Eclipse Temurin 17.0.10
- Git 2.44.0.windows.1
- spotless version
- spotless 6.25.0
- spotless-lib-extra 2.45.0
- operating system and version
- Windows 11 Pro 23H2 22635.3430
- copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
- All spotless related changes can be seen here in the PR for my project. -> https://github.com/IntelligenceModding/AdvancedPeripherals/pull/579
- copy-paste the full content of any console errors emitted by
gradlew spotless[Apply/Check] --stacktrace
A small portion:
Unable to parse date from command 'git log --follow --find-renames=40% --reverse -- C:\Users\info\IdeaProjects\AdvancedPeripherals\src\main\java\de\srendi\advancedperipherals\common\addons\computercraft\owner\IOwnerAbility.java':
java.lang.IllegalArgumentException: Unable to parse date from command 'git log --follow --find-renames=40% --reverse -- C:\Users\info\IdeaProjects\AdvancedPeripherals\src\main\java\de\srendi\advancedperipherals\common\addons\computercraft\owner\I
OwnerAbility.java':
at com.diffplug.spotless.generic.LicenseHeaderStep$Runtime.parseYear(LicenseHeaderStep.java:467)
Full log: https://gist.github.com/SirEndii/e0ed12833caec97f39e9c14935a0ad0f
The full command I'm trying to use gradlew spotless[Apply/Check] -PspotlessSetLicenseHeaderYearsFromGitHistory=true
When I try to use the git log command, it only works without the --follow parameter. I am not too familiar with the git log command to know exactly what the issue could be. This also happens when I try to use different java files from the project
- Dominant language
- Java
- Stars
- 5.7k
- Forks
- 560
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 43
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from diffplug/spotless
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
All issues in diffplug/spotless
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
checkstyle/test-configs#263 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·