Skip to content

Update snapshot tests with stripMargin - #314

Merged
zainab-ali merged 1 commit into
typelevel:mainfrom
zainab-ali:assert-inline-snapshot-rewrite
Apr 27, 2026
Merged

zainab-ali merged 1 commit into
typelevel:mainfrom
zainab-ali:assert-inline-snapshot-rewrite

Conversation

@zainab-ali

@zainab-ali zainab-ali commented Apr 27, 2026 •

Copy link
Copy Markdown
Collaborator

assertInlineSnapshot tests now insert stripMargin calls into multi-line strings.

This PR updates all snapshots. It contains no logic changes, only formatting changes.

Method

The following scalafix rule rewrites assertInlineSnapshot(result, "snapshot") calls to assertInlineSnapshot(result, ???).

package fix

import scalafix.v1._
import scala.meta._

class AssertInlineSnapshot extends SemanticRule("AssertInlineSnapshot") {
  override def fix(implicit doc: SemanticDocument): Patch = {
    doc.tree.collect { 
      case tree @ q"assertInlineSnapshot($a, $b)" =>
        Patch.replaceTree(tree, s"assertInlineSnapshot($a, ???)")
    }.asPatch
  }
}

After running it, the snapshots were regenerated with sbt test; sbt snapshot4sPromote

@zainab-ali
zainab-ali force-pushed the assert-inline-snapshot-rewrite branch from 87f8c69 to b6e5390 Compare April 27, 2026 16:20
@zainab-ali
zainab-ali marked this pull request as draft April 27, 2026 16:20
@zainab-ali zainab-ali changed the title Update snapshot test with stripMargin Update snapshot tests with stripMargin Apr 27, 2026
@zainab-ali
zainab-ali marked this pull request as ready for review April 27, 2026 18:30
@zainab-ali
zainab-ali merged commit 733555b into typelevel:main Apr 27, 2026
13 checks passed
@zainab-ali
zainab-ali deleted the assert-inline-snapshot-rewrite branch April 27, 2026 18:30
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.

1 participant