kiliankoe / swift-outdated

A swift subcommand for displaying when your dependencies (SwiftPM or Xcode) are out of date
MIT License
342 stars 14 forks source link

Ignore pre-release #34

Closed squarefrog closed 1 year ago

squarefrog commented 1 year ago

Firstly, thanks for the package, it's so useful for our CI where we post messages for outdated dependencies!

One feature I think would be really useful would be the option to ignore pre-release versions. For example, one of the packages we use returns the following tags:

refs/tags/5.3.1
refs/tags/5.4.0
refs/tags/5.4.1
refs/tags/5.4.2
refs/tags/5.5.0-beta.1

The last version we'd be interested in would be 5.4.2.

To not introduce a breaking change, this could behind an opt-in argument:

swift outdated --ignore-prerelease

The only blocker I can immediately think of, is that I'm not sure the -beta.1 suffix is standardised. We have a fair number of packages within our app, which would give us a good starting point for trying to figure out what a decent filter would be.

squarefrog commented 1 year ago

Actually, after digging into the source code, I dont think this would be too challenging to do, as Version already has a prereleaseIdentifiers array. I'll take a stab at making a PR for this.

kiliankoe commented 1 year ago

Thanks again for the change!

It'll be available with 0.7.0 in https://github.com/Homebrew/homebrew-core/pull/140503 :)

squarefrog commented 1 year ago

Thanks for the speedy review and release!