fables-tales / rubyfmt

Ruby Autoformatter!
MIT License
1.07k stars 50 forks source link

CLI incorrectly reports a new version being available on the most recent release #386

Closed reese closed 1 year ago

reese commented 1 year ago

This occurs on any input:

% echo "class Foo; end" | rubyfmt
class Foo
end
A new version of rubyfmt is available at https://github.com/penelopezone/rubyfmt/releases/tag/v0.8.0
% rubyfmt --version
rubyfmt-main 0.8.0-pre

This breaks because

I would expect this not to tell me a new version is available if I'm on the latest version. This might be related to the -pre tag, but I haven't looked enough at how this update check works to know if that matters.

reese commented 1 year ago

Ah I actually know why this is -- when we released v0.8.0, in the Cargo.toml we actually marked it as a prelease (v0.8.0-pre). We also did this in the GitHub release originally, but brew doesn't let you release something marked as a prerelease on GitHub, so we made it no longer a prerelease, so the GitHub version marker is technically different (and this update check is done by querying the latest GH release).

TL;DR -- I don't really think there's anything we should do here other than we should no longer be marking these as prereleases internally, because (a) having it on brew means it necessarily can't be a prerelease and (b) this is already supporting millions of lines of code in production daily, so I think it's fair that it's no longer a prerelease anyways.