Skip to content

fileSummary support directory inputs#190

Merged
andersone1 merged 5 commits intomainfrom
feat-file-summary-directory-input
Feb 6, 2026
Merged

fileSummary support directory inputs#190
andersone1 merged 5 commits intomainfrom
feat-file-summary-directory-input

Conversation

@andersone1
Copy link
Collaborator

@andersone1 andersone1 commented Feb 5, 2026

Summary

This PR updates fileSummary() so it can accept either a single file path or a directory path.

What Changed

  • Added directory handling in fileSummary() using fs::is_dir().
  • When a directory is supplied, fileSummary() now:
    • Lists immediate files in that directory.
    • Excludes subdirectories.
    • Runs fileSummary() on each file.
    • Invisibly returns a named list of per-file summaries.
  • Kept existing single-file behavior intact.
  • Updated error text to reflect the new input contract (single file or directory path).
  • Updated documentation (R/fileSummary.R, man/fileSummary.Rd) including examples.
  • Added tests for directory input and updated existing input-validation expectations.

Why

This removes the need for external loops like:
purrr::walk(list.files(...), ~ review::fileSummary(.file = .x))
and makes directory-level summaries a built-in behavior of fileSummary().

@andersone1 andersone1 merged commit 80e46e4 into main Feb 6, 2026
6 checks passed
@andersone1 andersone1 deleted the feat-file-summary-directory-input branch February 6, 2026 00:16
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