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

530 idempotency parsing error message #535

Merged
merged 3 commits into from
Jun 27, 2023

Conversation

torhovland
Copy link
Member

Fixes #530.

  • Improved error message when idempotency fails due to invalid output in the first pass.

@Niols
Copy link
Member

Niols commented Jun 27, 2023

Then:

$ nix run github:tweag/topiary/cba1993 -- -l ocaml <<EOF
let id = if true then Fun.id else function x -> x
EOF
[2023-06-27T08:37:48Z ERROR topiary] Parsing error between line 1, column 46 and line 1, column 47

Now:

$ nix run github:tweag/topiary/a3a04b3 -- -l ocaml <<EOF
let id = if true then Fun.id else function x -> x
EOF
[2023-06-27T08:37:56Z ERROR topiary] The formatter produced invalid output and
    failed when trying to format twice (idempotence check).
    
    If this happened with the built-in query files, it is a bug. It would be
    helpful if you logged this error at
    https://github.com/tweag/topiary/issues/new?assignees=&labels=type%3A+bug&template=bug_report.md
    
    The following is the error received when running the second time, but note
    that any line and column numbers refer to the formatted code, not the
    original input. Run Topiary with the --skip-idempotence flag to see this
    invalid formatted code.
[2023-06-27T08:37:56Z ERROR topiary] Cause: Parsing error between line 1, column 46 and line 1, column 47

Looks great to me!

@torhovland torhovland enabled auto-merge (squash) June 27, 2023 08:42
@torhovland torhovland merged commit 331c1b0 into main Jun 27, 2023
@torhovland torhovland deleted the 530-idempotency-parsing-error-message branch June 27, 2023 10:09
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.

Better reporting on parsing error caused by idempotency problems
3 participants