Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid repeating versions in Eviction error message #386

Merged

Conversation

rtyley
Copy link
Contributor

@rtyley rtyley commented Sep 17, 2021

Currently the evicted version numbers can be repeated many times:

[error] * org.scala-lang.modules:scala-java8-compat_2.13:1.0.0 (early-semver) is selected over {0.9.0, 0.9.0, 0.9.0, 0.9.0, 0.9.1, 0.9.1, 0.9.1}

This change makes for a clearer message by removing that unnecessary noisy repetition:

[error] * org.scala-lang.modules:scala-java8-compat_2.13:1.0.0 (early-semver) is selected over {0.9.0, 0.9.1}

Thanks!

Rather than seeing an error like this, with the evicted version numbers
being repeated many times:

```
[error] 	* org.scala-lang.modules:scala-java8-compat_2.13:1.0.0 (early-semver) is selected over {0.9.0, 0.9.0, 0.9.0, 0.9.0, 0.9.1, 0.9.1, 0.9.1}
```

...I'd much rather see an error like this:

```
[error]         * org.scala-lang.modules:scala-java8-compat_2.13:1.0.0 (early-semver) is selected over {0.9.0, 0.9.1}
```
@rtyley rtyley force-pushed the avoid-repeating-version-in-eviction-error branch from 0bbe7d4 to 9786906 Compare September 17, 2021 17:12
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@eed3si9n eed3si9n merged commit 54c1ee5 into sbt:develop Sep 19, 2021
@rtyley rtyley deleted the avoid-repeating-version-in-eviction-error branch September 19, 2021 07:00
rtyley added a commit to rtyley/librarymanagement that referenced this pull request Sep 16, 2023
As with sbt#386, which dealt
with Eviction *errors*, this fixes the way Eviction *warnings* report
the list of evicted versions - removing duplicate versions - and does a
refactor so that both `EvictionError` & `EvictionWarning` are using the
same logic to generate the revision string.

The logic for the revisions string is moved to the new field
`EvictionPair.evictedRevs`.

Without this fix, we see Eviction warnings like this:

```
* org.scala-lang.modules:scala-java8-compat_2.13:1.0.2 is selected over {1.0.0, 1.0.0}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants