do not produce a suprious empty correction in deriving_inline #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Do not produce a suprious empty correction when deriving_inline expands into an extension that undergoes further expansion.
Empty corrections arise in particular when
deriving_inlinecan see that the generated AST differs from the one in the source file, but after passing it through the styler it becomes the same.I tried writing a test, but it doesn't seem to demonstrate the issue.
Apparently behavior is different between the two modes the driver is invoked:
If
diff_command = "-"then we just "exit 0" after producing the corrected file (so the AST difference goes undetected).If
diff_command <> "-"then we "exit 1" so a very confusing error is reported (empty diff).If I just run inline tests with dune, I get the former behavior so it's impossible to observe the improvement. The way we run it in Jane Street,
diff_commandis not"-"so we can see the difference.Signed-off-by: Arseniy Alekseyev [email protected]