diffplug / diffplug/spotless

LicenseHeaderStep with `git --follow` in some repositories produces garbage year history

Open
#774 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
5.6k
Forks
559
Avg merge
1d 13h
Merged PRs (30d)
34

Description

- [x] 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

- [x] gradle or maven version
Gradle 6.7.1

- [x] spotless version
5.8.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.