Skip to content

Move detectMaxPercentDifferenceDefault method to Paparazzi.kt#2261

Open
nishatoma wants to merge 2 commits intocashapp:masterfrom
nishatoma:move-util-method-config
Open

Move detectMaxPercentDifferenceDefault method to Paparazzi.kt#2261
nishatoma wants to merge 2 commits intocashapp:masterfrom
nishatoma:move-util-method-config

Conversation

@nishatoma
Copy link
Copy Markdown
Contributor

@nishatoma nishatoma commented Feb 7, 2026

Hello! As part of feedback from here:

https://github.com/cashapp/paparazzi/pull/2203/changes/BASE..82b4fe2b566ffb055ea434af9b65e2c46f5c5ea1#diff-2c10da07633a221584f8c9dd4d75419da14f458fbc5d0eed23cba5f49a530273R44

This is a follow-up PR that moves the detectMaxPercentDifferenceDefault to Paparazzi.kt.

@jrodbx let me know if you have any additional feedback on that.

Comment thread paparazzi/src/main/java/app/cash/paparazzi/Paparazzi.kt Outdated
}
}

public object PaparazziUtils {
Copy link
Copy Markdown
Contributor

@geoff-powell geoff-powell Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this seems unnecessary to wrap this public fun in an object. Can we just make it class level?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay, did you mean something like this?

public fun detectMaxPercentDifferenceDefault(): Double =
    System.getProperty("app.cash.paparazzi.maxPercentDifferenceDefault")?.toDoubleOrNull() ?: 0.01

It would be an instance method within Paparazzi() is that what you meant? If so, it would not be usable anymore as is on lines 37 and 56 within the constructor.

Or do you mean like a top-level function within Paparazzi.kt file itself?

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.

2 participants