diffplug / diffplug/spotless

Implement a global non-maven download policy

オープン
#1,669 コメント 9 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Java
スター
5.7k
フォーク
561
平均マージ
1日 14時間
マージ済み PR(30日)
43

説明

The Spotless core has few dependencies. During plugin configuration, we add maven dependencies which get downloaded in the normal way.

There are some exceptions where we use non-maven formatters. For example

- npm-based formatters which grab dependencies using npm install
- eclipse-based formatters which download dependencies from p2 update sites
- #1629
- #1658

There are other cases we are considering, such as

- #1663
- #674
- #673

A very good thing about Spotless is that it "just works". Search the docs for the kind of formatter you want, specify that formatter, and you're ready to go. But for these non-maven-based formatters, I think it's fair for users to be surprised that their build plugin is making network requests and caching artifacts outside of the expected maven channel.

I'm proposing something like this:

```gradle
spotless {
allowDownloadsFrom('https://download.eclipse.org/')
```

As a user, it would work like this:

- I add Eclipse CDT to my spotless configuration
- I get an error like so

> Eclipse CDT is not available in a maven repository, it must be downloaded from a p2 repository. You can allow this download by adding a block like this to your spotless configuration
>
> spotless {
>   allowDownloadsFrom('https://download.eclipse.org/')
>
> This will allow Spotless to download p2 metadata and jar files using the Equo p2 client. The metadata and jar files will be cached at ~/.equo. Alternatively, you can specify an alternative p2 update site, and add that URL to your allowDownloadsFrom.

It's not a perfect mechanism, it relies on our own diligence in making sure that PR's such as the Rome PR follow the rules about checking the allowed URLs. But it takes away the surprise, which is important. Users might choose a different formatter based on whether it is available through a standard maven proxy or not.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Spotless core のプラグイン設定パスと、#1629 および #1658 で説明されている非 Maven の formatter ケースから始めます。提案されている allowDownloadsFrom ポリシーを、npm install と p2 update-site の例と併せて確認します。非 Maven のダウンロードが明示的に許可され、そうでない場合は実行可能なガイダンスとともに拒否され、検討対象のすべてのケースがカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
build-system, tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。