Repository navigation
ppx_devtools.expect: indent promoted code like the code around it, and fixes - #7
Merged
Merged
Conversation
hhugo
force-pushed
the
expect-promotion-indent
branch
from
November 3, 2026 08:16
91bace2 to
f7105b3
Compare
hhugo
force-pushed
the
expect-unreachable
branch
from
November 3, 2026 08:16
516f86f to
d2ffc3b
Compare
hhugo
force-pushed
the
expect-promotion-indent
branch
from
November 3, 2026 08:28
f7105b3 to
9ebce58
Compare
hhugo
force-pushed
the
expect-unreachable
branch
from
November 3, 2026 08:42
661410f to
a65423d
Compare
hhugo
force-pushed
the
expect-promotion-indent
branch
from
November 3, 2026 08:42
9ebce58 to
5db69eb
Compare
hhugo
force-pushed
the
expect-unreachable
branch
from
November 3, 2026 08:53
a65423d to
e183abe
Compare
hhugo
force-pushed
the
expect-promotion-indent
branch
from
November 3, 2026 08:53
5db69eb to
50b2b55
Compare
hhugo
force-pushed
the
expect-unreachable
branch
from
November 3, 2026 09:03
e183abe to
6f606c1
Compare
hhugo
force-pushed
the
expect-promotion-indent
branch
2 times, most recently
from
November 4, 2026 08:12
8fb5c5d to
86f849c
Compare
hhugo
force-pushed
the
expect-promotion-indent
branch
from
November 16, 2026 22:59
5b7943e to
7be5447
Compare
- Indentation is copied from the source, tabs included, instead of being counted in spaces. Literals indented with tabs now compare equal to the output. - A new [%expect] after a body written on the [let%expect_test] line is indented one step past the test instead of starting at column 0. - An inserted [@@expect.uncaught_exn] is indented like its test, e.g. inside a module. Also use our own wording for the header of an [%expect] that saw different outputs: "CR ppx_devtools-expect: this [%expect] saw different outputs". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Deleting a [@@expect.uncaught_exn] attribute deleted everything from the end of the test body, including other attributes such as [@@if] and comments. Only the attribute and the whitespace in front of it are deleted now. - A [match], [try] or [function] ending the body as the last argument of an application (e.g. [print_string @@ match ...]) got the appended [%expect] in its last case. The search for such an expression now goes through applications, constructors and field assignments. - Counting a tab as a column of common indentation made outputs that differ in tabs and spaces compare equal. The common indentation is now a common whitespace prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hhugo
force-pushed
the
expect-promotion-indent
branch
from
November 16, 2026 23:14
7be5447 to
c89dd6f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #6.
let%expect_testline, a test nested in a module, and an inserted[@@expect.uncaught_exn]no longer get code at the wrong column.[%expect]that saw different outputs uses our own wording:(* CR ppx_devtools-expect: this [%expect] saw different outputs *).[@@expect.uncaught_exn]attribute deleted everything from the end of the test body, including other attributes and comments. Only the attribute and the whitespace in front of it are deleted now.match,tryorfunctionending the body as the last argument of an application (e.g.print_string @@ match ...) got the appended[%expect]in its last case.Tests: new cases in
test/promote/promote_me.ml.🤖 Generated with Claude Code