You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that standalone files from core tidyverse packages should be ignored from styling.
At the moment, the default values for exclude_files is c("R/RcppExports.R", "R/cpp11.R"), but I think it could be c("R/RcppExports.R", "R/cpp11.R", "R/import-standalone-*")
or a new argument exclude_import_standalone that would default to TRUE.
If you are not familiar with the new standalone files, here are some references
A PR in dplyr where they use it tidyverse/dplyr#6722. They also use it in ggplot2
In a package, if I use
usethis::use_standalone("r-lib/rlang", "types-check")
Thefilewillbecopiedto`mypkg/R/important-standalone-type-check.R`# it will be read-only.# but when I run, `styler::style_pkg()`, it will restyle the file.
I think that because these files appear as read-only in RStudio. If they are to be styled, they should be styled in the original repos (in this case in rlang)
The text was updated successfully, but these errors were encountered:
Ok I see. I agree these should probably not be styled by default. A simple way to do that would be to make exclude_files take regex patterns instead of file names. We could adapt the default value such that the behavior is the same as now. Are you interested in making a PR? I can provide guidance.
olivroy
changed the title
standalone files from other packages should be ignored in style_pkg()
standalone files imported from other packages should be ignored in style_pkg()Jun 29, 2023
Hi,
I think that standalone files from core tidyverse packages should be ignored from styling.
At the moment, the default values for
exclude_files
isc("R/RcppExports.R", "R/cpp11.R")
, but I think it could bec("R/RcppExports.R", "R/cpp11.R", "R/import-standalone-*")
or a new argument
exclude_import_standalone
that would default toTRUE
.If you are not familiar with the new standalone files, here are some references
https://usethis.r-lib.org/reference/use_standalone.html
https://github.com/r-lib/rlang/blob/main/R/standalone-types-check.R
A PR in dplyr where they use it tidyverse/dplyr#6722. They also use it in ggplot2
In a package, if I use
I think that because these files appear as read-only in RStudio. If they are to be styled, they should be styled in the original repos (in this case in rlang)
The text was updated successfully, but these errors were encountered: