Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new: atddiff tool #358

Merged
merged 24 commits into from
Oct 15, 2023
Merged

new: atddiff tool #358

merged 24 commits into from
Oct 15, 2023

Conversation

mjambon
Copy link
Collaborator

@mjambon mjambon commented Oct 12, 2023

This implements #352

I still need to review the test results more carefully and add tests. For now, the output is text. We can add JSON output in another PR (see #360).

PR checklist

  • New code has tests to catch future regressions
  • Documentation is up-to-date
  • CHANGES.md is up-to-date

@mjambon mjambon marked this pull request as draft October 12, 2023 06:57
@mjambon
Copy link
Collaborator Author

mjambon commented Oct 12, 2023

to do: avoid infinite looping on recursive type definitions

Copy link

@aryx aryx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

atddiff/src/bin/Atddiff_main.ml Outdated Show resolved Hide resolved
atddiff/test/test_new.atd Outdated Show resolved Hide resolved
@mjambon
Copy link
Collaborator Author

mjambon commented Oct 12, 2023

Another important thing to do is honor the <json ...> annotations. These are used to rename field/constructor names and for a few other format alterations.

@aryx
Copy link

aryx commented Oct 13, 2023

ship it!

some comparison e.g. 'type t = a' and 'type t = b' will result in
treating types 'a' and 'b' as the same type.
- object field renaming with '<json name="...">'
- enum/variant renaming with '<json name="...">'
- JSON maps with '(string * _) list <json repr="object">'
@mjambon mjambon marked this pull request as ready for review October 15, 2023 06:24
@mjambon
Copy link
Collaborator Author

mjambon commented Oct 15, 2023

This is feature-complete for a first release unless I forgot something. I'll update the documentation in another PR while the opam release is in progress.

@mjambon mjambon merged commit e09e6e8 into master Oct 15, 2023
2 checks passed
mjambon added a commit to mjambon/opam-repository that referenced this pull request Oct 16, 2023
CHANGES:

* atdts: Stop compiler errors on generated typescript (ahrefs/atd#348)
* atdts: Don't fail on `wrap` constructs (ahrefs/atd#353)
* atdcat: New option `-remove-wraps` which pretty-prints the type
  definitions without `wrap` constructs (ahrefs/atd#353)
* atdd: Add `dlang` backend to generate D code from ATD definitions (ahrefs/atd#349)
* new tool: atddiff. Compares two versions of an ATD file and reports
  possible incompatibilities in the JSON data. Atddiff ships as part of the
  `atd` package together with `atdcat` (ahrefs/atd#352, ahrefs/atd#358)
nberth pushed a commit to nberth/opam-repository that referenced this pull request Jun 18, 2024
CHANGES:

* atdts: Stop compiler errors on generated typescript (ahrefs/atd#348)
* atdts: Don't fail on `wrap` constructs (ahrefs/atd#353)
* atdcat: New option `-remove-wraps` which pretty-prints the type
  definitions without `wrap` constructs (ahrefs/atd#353)
* atdd: Add `dlang` backend to generate D code from ATD definitions (ahrefs/atd#349)
* new tool: atddiff. Compares two versions of an ATD file and reports
  possible incompatibilities in the JSON data. Atddiff ships as part of the
  `atd` package together with `atdcat` (ahrefs/atd#352, ahrefs/atd#358)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants