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

Add CBOR diagnostic files for ease of code review #659

Merged
merged 4 commits into from Jul 21, 2019

Conversation

Gabriella439
Copy link
Contributor

Fixes #656

This adds a human-readable .diag file containing the CBOR diagnostic
representation for the corresponding .dhallb file, for ease of
reviewing changes to encoded expressions.

This also adds:

  • A new ./scripts/generate-diagnostic-files.sh script for keeping the
    *.diag files up-to-date
  • A new CI check to ensure the contributor hasn't forgotten to update those
    files

This also removes the ./tests/diff-binary.sh script since it's no longer
necessary.

Fixes #656

This adds a human-readable `.diag` file containing the CBOR diagnostic
representation for the corresponding `.dhallb` file, for ease of
reviewing changes to encoded expressions.

This also adds:

* A new `./scripts/generate-diagnostic-files.sh` script for keeping the
  `*.diag` files up-to-date
* A new CI check to ensure the contributor hasn't forgotten to update those
  files

This also removes the `./tests/diff-binary.sh` script since it's no longer
necessary.
@Gabriella439 Gabriella439 mentioned this pull request Jul 21, 2019
Copy link
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

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

Thank you! This is great! :)

@sjakobi
Copy link
Collaborator

sjakobi commented Jul 21, 2019

CI seems to work:

Only in ./tests.expected/parser/success/unit: ListLitEmptyPrecedenceB.diag
diff --recursive ./tests.actual/parser/success/unit/import/urls/potPourriB.diag ./tests.expected/parser/success/unit/import/urls/potPourriB.diag
1c1
< [24, null, 0, 1, null, "-._~%2C!$&'*+;=:@0abc1--12a------a-a--a-0", "foo", "/-._~%2C!$&%27*+;=:@/?"]
---
> [24, null, 0, 1, null, "-._~%2C!$&'*+;=:@0abc1--12a------a-a--a-0", "foo", "/-._~%2C!$&'*+;=:@/?"]
builder for '/nix/store/fckqqq62vi62yw8v1f1g36j8fzl2yy3d-diagnostic-files-lint.drv' failed with exit code 1

👍

${pkgsNew.rsync}/bin/rsync --archive ${pkgsNew.expected-diagnostic-files}/ ./tests.expected
${pkgsNew.rsync}/bin/rsync --archive ${./tests}/ ./tests.actual

${pkgsNew.diffutils}/bin/diff --recursive ./tests.{actual,expected}
Copy link
Member

Choose a reason for hiding this comment

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

Don't you need to do something here to assert that there are no differences? Or does diff exit with non-zero if there are differences?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ocharles: diff exits with a non-zero exit code if there are differences

@Gabriella439 Gabriella439 merged commit 5cfca52 into master Jul 21, 2019
@Gabriella439 Gabriella439 deleted the gabriel/add_diagnostic_files branch July 21, 2019 15:08
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.

.dhallb ergonomics
5 participants