Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format_r() error when used on single file #625

Open
marcusyoung opened this issue Feb 21, 2025 · 0 comments
Open

format_r() error when used on single file #625

marcusyoung opened this issue Feb 21, 2025 · 0 comments
Labels
status: triage Awaiting review and labeling by a core developer

Comments

@marcusyoung
Copy link

marcusyoung commented Feb 21, 2025

Steps to reproduce

rhino::format_r("/app/view/filename.R")

Bug description

format_r() throws an error when a specific file is specified:

Error in `setwd()`:
! cannot change working directory
Hide Traceback
    ▆
 1. └─rhino::format_r("/app/view/filename.R")
 2.   └─box.linters (local) style_box_use(path, exclude_files = exclude_files)
 3.     └─withr::with_dir(...)
 4.       └─base::setwd(dir = new)
>

Works fine when just a directory is specified.

Expected behavior

To format the specific file as stated in the docs.

Rhino diagnostics

Windows 10 x64 build 26100
R version 4.4.2 (2024-10-31 ucrt)
rhino: 1.10.1
node: v22.12.0

Comments

No response

@marcusyoung marcusyoung added the status: triage Awaiting review and labeling by a core developer label Feb 21, 2025
@marcusyoung marcusyoung changed the title format_r() error when used on specific file format_r() error when used on single file Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage Awaiting review and labeling by a core developer
Projects
None yet
Development

No branches or pull requests

1 participant