borkdude / api-diff

Print API diffs between library versions
59 stars 2 forks source link

Consider showing additions #14

Open lread opened 3 years ago

lread commented 3 years ago

Proposal Api-diff currently shows what has been removed. The (very worthy) focus, it seems, is on discovering breakages.

It can also be interesting to see what was added to an API. What new things can I do?

This can be achieved by swapping x1 and x2 in the diff comparison, but this, to me, seems awkward because the diff is still described in terms of removals.

Implementation ideas Show the user:

What might we report? Maybe something like:?

x/y/z.cljc:10:1: info: x.y.z/new-def-x was added.
x/y/z.cljc:20:1: info: x.y.z/changed-defn-y Arity 10 was added.
x/y/z.cljc:30:1: info: x.y.z/new-defn-z was added.
x/y/z.cljc:30:1: info: x.y.z/new-defn-z Arity 1 was added. 

We would also need to include reason of additions, see #13.

test-resources/older/example.clj:6:1: info: example/becomes-public now public.
test-resources/older/example.clj:8:1: info: example/loses-nodoc now included in diff (meta :no-doc).

To work out

  1. Is this idea interesting?
  2. Optionally or always show additions?
  3. Or only show one of: additions or removals?
  4. Separate additions from removals in reporting? One tells about breakages, the other about opportunities.

Next steps Refine with anybody who might be interested in this feature.

borkdude commented 3 years ago

Yeah, this seems nice!

borkdude commented 3 years ago

This can be closed I guess?

lread commented 3 years ago

Nope, have not started on this one yet! 🙂

borkdude commented 3 years ago

Oops, sorry, I was mixing stuff up.

lread commented 3 years ago

No problemo, the fact that I referenced this issue from a PR was what probably caught your eye.