insta icon indicating copy to clipboard operation
insta copied to clipboard

YAML block formatting for expression string

Open dcecile opened this issue 6 months ago • 1 comments

My expression has newlines, which show up fine in cargo insta review, but it would be nice to have the string be block formatted in the YAML text (e.g. for review in PRs):

---
source: sheets/src/evaluation/functions/math/abs.rs
expression: "mock_eval_sheet_data(array![[\"-1\", \"=ABS(A1)\"], [\"1\", \"=ABS(A2)\"],\n[\"0\", \"=ABS(A3)\"], [\"10000\", \"=ABS(A4)\"]]).await"
---
[[[-1.0], [1.0]],
 [[1.0], [1.0]],
 [[0.0], [0.0]],
 [[10000.0], [10000.0]]]

dcecile avatar Jun 26 '25 19:06 dcecile

I agree this would be nice! previously we didn't want to add a yaml dependency to the basic insta. but:

  • possibly that's less of an issue now that we've vendored it
  • it's probably possible to do without a yaml dependency; can we just add a block format with normal text for multi-line expressions?

would take a PR!

max-sixty avatar Jun 30 '25 21:06 max-sixty