ocaml-semver / ocaml-api-watch

Libraries and tools to keep watch on you OCaml lib's API changes
ISC License
21 stars 15 forks source link

Detected addition and removal of type declarations #92

Closed azzsal closed 1 month ago

azzsal commented 1 month ago

This should resolve #83 and extend it to include detection of modified type declarations, as @panglesd suggested. This is a continuation on the work of #89. I have closed it, since the rebase gone wrong.

azzsal commented 1 month ago

I have added the case for the detection of type declarations modification. The failing tests indicate that signature items are added and removed again, I am guessing that's due to the change of the map key type to item_type * Ident.t. Please have a look @panglesd @NathanReb.

panglesd commented 1 month ago

I am guessing that's due to the change of the map key type to item_type * Ident.t

Yes exactly, I think that is the issue! Two items of the same name are likely to get two different idents, in their respective compilation units.

azzsal commented 1 month ago

I have returned the map key type to item_type * string, and stored the compilation unit id of an item in the map value. All tests pass now, except for one test for a nested module signature.

panglesd commented 1 month ago

This test is a test for dyslexia! The is a typo: shpae instead of shape.

azzsal commented 1 month ago

Sorry, I should have noticed that! All tests now pass!

NathanReb commented 1 month ago

Rebasing is a bit hard at first but it's in important skill as it helps keeping a clean history and is the prefered method in quite a few repositories.

It's also easier to do if you stick to logical and self contained commits. If each single commit is clearly named and has its intent well specified, builds and passes the tests it becomes clear what to do to re-apply it on top of modified codebase and whether you did it right in the end.

panglesd commented 1 month ago

Can you add a changelog entry? For the format, you can see this example.