Skip to content

Conversation

@hadley
Copy link
Member

@hadley hadley commented Aug 13, 2025

Fixes #2207

@claude
Copy link

claude bot commented Aug 13, 2025

Claude finished @hadley's task —— View job


Review

Issues found:

  1. Unused field in R/reporter-check.R:16: has_snapshot_failure is added but never used anywhere

  2. Minor inefficiency in R/snapshot-file.R:145-148: When in_rcmd_check() is true, hint is set to empty string but snapshot_review_hint() is still called unnecessarily

Otherwise the implementation looks correct - snapshot hints are now only shown in the check reporter when there are actual snapshot failures, which addresses the goal of notifying once.

@hadley hadley requested a review from gaborcsardi August 13, 2025 17:06
@hadley
Copy link
Member Author

hadley commented Aug 13, 2025

@gaborcsardi can you take a look at this? Mostly so you know about it as you work on the next version of the CheckReporter.

Copy link
Member

@gaborcsardi gaborcsardi left a comment

Choose a reason for hiding this comment

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

Nice improvement! Left a comment.

} else {
"* Locate check directory."
},
"* Copy 'tests/testthat/_snaps' to local package."
Copy link
Member

Choose a reason for hiding this comment

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

I think the wording here can be misleading. Not just this line, the whole copy part. A failing snapshot does not necessarily mean that you need to update the snapshots, maybe it is a genuine test failure. (If I understand correctly when this is invoked.) Or it is a problem of platform dependent snapshots, in which case you can't simply update the snapshot files.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm, yeah the advice is supposed to more about how to diagnose the failure locally. I'll tweak.

@hadley hadley merged commit c45ce93 into main Aug 13, 2025
13 checks passed
@hadley hadley deleted the check-snaps branch August 13, 2025 18:44
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.

In CheckReporter, only display snapshot messaging once

3 participants