hackage-diff icon indicating copy to clipboard operation
hackage-diff copied to clipboard

Suggest new version

Open agrafix opened this issue 8 years ago • 6 comments
trafficstars

Nice tool! :-) It would be really nice if the tool could also suggest the next version, maybe even with a flag for selecting either PVP or SemVer?

agrafix avatar Dec 22 '16 13:12 agrafix

Glad you like it!

I don't understand what 'next version' should be suggested?

blitzcode avatar Dec 22 '16 19:12 blitzcode

Currently, I can call the tool with hackage-diff conduit 1.1.5 ~/tmp/conduit-1.1.6/dist/doc/html/conduit/conduit.txt to see the API diff between conduit 1.1.5 and the local conduit 1.1.6. What I would like to do would be to call hackage-diff --pvp-version conduit 1.1.5 ~/my-local-unreleased-conduit and the tool outputs something like this:

Based on this diff:

+ Data.Serialize.IEEE754
  + getFloat32be :: Get Float
  + getFloat32le :: Get Float
  + getFloat64be :: Get Double
  + getFloat64le :: Get Double
  + putFloat32be :: Float -> Put
  + putFloat32le :: Float -> Put
  + putFloat64be :: Double -> Put
  + putFloat64le :: Double -> Put
× Data.Serialize
  + instance Serialize a => GSerialize (K1 i a)
[...]

we can see a BREAKING CHANGE. Thus, the new version for ~/my-local-unreleased-conduit must be at least 2.0.0

agrafix avatar Dec 22 '16 23:12 agrafix

Hm, not sure I find that terribly useful. I mean, it's basically if breakingChange then bumpMajor else bumpMinor? That just seems like it would require zero mental effort to do yourself and copy & pasting the version number from the output (and / or typing --pvp-version) might actually be more work than to just +1 an integer in the .cabal file 'manually'.

blitzcode avatar Dec 23 '16 11:12 blitzcode

That's true, but this way one could include it in the CI pipeline and have it enforced (or at least checked) automatically.

Am 23.12.2016 um 12:13 schrieb Tim C. Schröder [email protected]:

Hm, not sure I find that terribly useful. I mean, it's basically if breakingChange then bumpMajor else bumpMinor? That just seems like it would require zero mental effort to do yourself and copy & pasting the version number from the output (and / or typing --pvp-version) might actually be more work than to just +1 an integer in the .cabal file 'manually'.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

agrafix avatar Dec 23 '16 11:12 agrafix

Would it perhaps be even better then to have the process exit code indicate no changes / no breaking changes / breaking changes? Easiest to integrate into a script (no parsing).

blitzcode avatar Dec 23 '16 18:12 blitzcode

Yes, that sounds great! Then everything else can be implemented around it via script.

agrafix avatar Dec 24 '16 13:12 agrafix