rtimush / sbt-updates

sbt plugin that can check Maven and Ivy repositories for dependency updates
BSD 3-Clause "New" or "Revised" License
761 stars 55 forks source link

Ordering of ScalaTest's snapshot versions is odd #128

Closed fthomas closed 5 years ago

fthomas commented 5 years ago

Hi,

I was wondering why sbt-updates didn't report ScalaTest 3.1.0-RC3 as an update for 3.1.0-SNAP13 and the reason is that VersionOrdering considers 3.1.0-RC3 less than 3.1.0-SNAP13. Here are all ScalaTest versions sbt-updates found ordered by VersionOrdering:

TreeSet(
  3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5-M1, 3.0.5, 3.0.6-SNAP1, 3.0.6-SNAP2,
  3.0.6-SNAP3, 3.0.6-SNAP4, 3.0.6-SNAP5, 3.0.6-SNAP6, 3.0.6, 3.0.7-RC1,
  3.0.7, 3.0.8-RC1, 3.0.8-RC2, 3.0.8-RC3, 3.0.8-RC4, 3.0.8-RC5, 3.0.8,
  3.1.0-M1, 3.1.0-M2, 3.1.0-RC1, 3.1.0-RC2, 3.1.0-RC3, 3.1.0-SNAP5,
  3.1.0-SNAP6, 3.1.0-SNAP7, 3.1.0-SNAP8, 3.1.0-SNAP9, 3.1.0-SNAP10,
  3.1.0-SNAP11, 3.1.0-SNAP12, 3.1.0-SNAP13, 3.2.0-M1, 3.2.0-SNAP1,
  3.2.0-SNAP2, 3.2.0-SNAP3, 3.2.0-SNAP4, 3.2.0-SNAP5, 3.2.0-SNAP6,
  3.2.0-SNAP7, 3.2.0-SNAP8, 3.2.0-SNAP9, 3.2.0-SNAP10
)

I think 3.1.0-SNAP13 should be less than 3.1.0-RC3 and will try to change VersionOrdering accordingly.

rtimush commented 5 years ago

I think it orders this part of the version lexicographically following semver#11. For the real-world libraries, it may indeed make sense to treat rc differently.