-
Notifications
You must be signed in to change notification settings - Fork 57
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
Provide a tool to compare two ATD files for compatibility #352
Comments
Thanks @mjambon - this looks great. A couple of thoughts: First, I'd love a
Second, if we wanted to use this as a commit hook, we'd probably need to be able to specify the constraints to enforce. In the JSON version above that might mean a pair of fields for type and severity instead of just |
@jbergler JSON output makes sense. Let's do this in addition to text. |
What about having the MVP only display a diff of the ASTs (no checking) at the type-level. Something like
|
Tentative design for the command-line interface:
GNU diff and Update:
|
@zyannes imo, an MVP is this:
But yeah, the issue is probably to explain the implications of the diffs e.g. explain what the following will break:
|
Looks great! Let's do it! |
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)
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)
@jbergler wrote:
I think it would be a relatively low effort to produce a tool (
atddiff
?) that compares two ATD files and reports differences:<
...>
annotations that changed (but without trying to interpret them)For example, let's compare two files,
Interface_v1.atd
againstInterface_v2.atd
:Regarding types whose name changes, I think this is generally not a problem and we can ignore these changes e.g.
veggie
→vegetable
. However, name changes for root types (types that are not referenced by other types) may have to be reported because it's possible that a root type gets both renamed and changes its structure. In such a case, we don't know for sure that it's the same type and we can't report incompatibilities confidently.Update: changed language from left-to-right/right-to-left to backward/forward. There's a 50% chance I got this right.
The text was updated successfully, but these errors were encountered: