LicenseHeaderStep with `git --follow` in some repositories produces garbage year history
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- git, java
- Domain
- build-system, tooling
Research direction
Start in lib/src/main/java/com/diffplug/spotless/generic/LicenseHeaderStep.java around lines 289-294 and inspect how git history is queried with --follow. Verify the behavior against the reported small functional-interface example, and consider the issue's proposed way to disable --follow so license-header years no longer include incorrect history.
Written by the indexing model from the issue text.
Description
- summary of problem
I have been working on migrating a project to use spotless for license headers. The project hasn't been great on keeping license headers up to date - so I used spotless's feature to allow fixing the header years from git history.
However with the project the --follow option for git produces a lot of garbage header years.
Examples being small functional interfaces created in 2020 resolving to get an incorrect year range of 2018, 2020.
Possible solution:
Allow disabling the --follow option for git history check here: https://github.com/diffplug/spotless/blob/a30553386acfa24f0d97f587249c38f44feb79b6/lib/src/main/java/com/diffplug/spotless/generic/LicenseHeaderStep.java#L289-L294
-
gradle or maven version
Gradle 6.7.1 -
spotless version
5.8.2
- 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 ·