LicenseHeaderStep with `git --follow` in some repositories produces garbage year history
- 主要言語
- Java
- スター
- 5.6k
- フォーク
- 559
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 43
説明
- [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
コントリビューションガイド
調査の方向性
lib/src/main/java/com/diffplug/spotless/generic/LicenseHeaderStep.java の289〜294行付近から始め、--follow を使って git の履歴をどのように問い合わせているかを調べてください。報告された小さな関数型インターフェースの例に対して動作を検証し、ライセンスヘッダーの年に誤った履歴が含まれなくなるように --follow を無効化する issue 提案の方法を検討してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- git, java
- 領域
- build-system, tooling
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100