Skip to content

Conversation

@hadley
Copy link
Member

@hadley hadley commented Aug 9, 2025

  • Generalise test_file_reporter() so we no longer need test_files_reporter_parallel()
  • Remove code needed for old R
  • Drop deprecated argument

local_snapshotter() is only used in devtools.

In preparation for #2066

* Generalise `test_file_reporter()` so we no longer need `test_files_reporter_parallel()`
* Remove code needed for old R
* Drop deprecated argument

`local_snapshotter()` is [only used in devtools](https://github.com/search?q=org%3Acran+local_snapshotter+&type=code).

In preparation for #2066
@hadley hadley requested a review from gaborcsardi August 9, 2025 13:51
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.

All good, but see one comment below.

@claude
Copy link

claude bot commented Aug 13, 2025

Claude finished @hadley's task —— View job


Code Review Progress

  • Read changed files and analyze refactoring
  • Check for potential bugs or issues
  • Evaluate reviewer suggestion about match.arg()
  • Provide feedback

Review

The refactoring looks clean and appropriate. Two observations:

  1. Missing match.arg() validation: Reviewer gaborcsardi correctly noted that test_files_reporter() should validate the mode parameter. Currently at line 323 in R/test-files.R:325, mode <- arg_match(mode) is called, but this should be added right after the function signature for proper parameter validation.

  2. Argument name consistency: The refactoring changes .env to frame parameter in test_files_reporter() and removes the explicit snap_dir parameter from local_snapshotter() call, which is fine since it defaults to "_snaps".

The generalization to eliminate test_files_reporter_parallel() is well-executed - the conditional logic for snapshot reporter selection is clean and the function signature unification makes sense.

LGTM with the suggested match.arg() addition.

@hadley hadley merged commit 79a9ed8 into main Aug 13, 2025
12 checks passed
@hadley hadley deleted the snapshot-refactoring branch August 13, 2025 12:54
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.

3 participants