Skip to content

Insta 2.0 ideas? #456

@max-sixty

Description

@max-sixty

Would be great to keep as much consistency as possible. But is there anything we want to change while we can?

A few ideas:

  • Update snapshot formats — already discussed
  • Do we want to attempt to make the macros simpler?
    • Currently we have (value) & (name, value) & (name, value, debug_expr) (+ redaction filters, inline, etc), which is arguably OK for experienced users, but less immediately obvious for new folks reading code.
    • We could move the debug_expr into with_settings.
    • Though the more difficult-to-understand part is that adding a value after the first value means adding it before the first value. And not sure whether there's a good solution.
  • Compel match .. in redactions? This allows rustfmt to work. Plausibly it also delineates the redaction expression for easier reading.
  • Would be great for inline snapshots to work with rustfmt, but don't think there's a way — if the inline snapshot is a normal expression without special syntax (such as @), it's not possible to discriminate between (name, value) and (value, snapshot)
  • Align syntax of filters & redactions? They are quite similar in purpose but currently defined very differently
  • Shorten snapshot file names? #377, possibly breaks too much for a very marginal benefit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions