LicenseHeaderStep with `git --follow` in some repositories produces garbage year history
- Langage dominant
- Java
- Étoiles
- 5.6k
- Forks
- 559
- Merge moyen
- 1 j 14 h
- PR mergées (30 j)
- 43
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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez dans lib/src/main/java/com/diffplug/spotless/generic/LicenseHeaderStep.java vers les lignes 289-294 et examinez comment l’historique git est interrogé avec --follow. Vérifiez le comportement avec le petit exemple d’interface fonctionnelle signalé et envisagez la méthode proposée dans l’issue pour désactiver --follow afin que les années de l’en-tête de licence n’incluent plus un historique incorrect.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- git, java
- Domaine
- build-system, tooling
- Type d'issue
- Bug
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 45/100