kou commented on code in PR #46686: URL: https://github.com/apache/arrow/pull/46686#discussion_r2122813044
########## r/vignettes/developers/workflow.Rmd: ########## @@ -51,31 +51,19 @@ pkgdown::build_site(preview=TRUE) ## Styling and linting -### R code - -The R code in the package follows [the tidyverse style](https://style.tidyverse.org/). On PR submission (and on pushes) our CI will run linting and will flag possible errors on the pull request with annotations. +You can automatically adjust our styling and lint by [pre-commit](https://pre-commit.com/): -To run the linter locally, install the `{lintr}` package (note, we currently use a fork that includes fixes not yet accepted upstream, see how lintr is being installed in the file [`ci/docker/linux-apt-lint.dockerfile`](https://github.com/apache/arrow/blob/main/ci/docker/linux-apt-lint.dockerfile) for the current status) and then run - -```r -lintr::lint_package("arrow/r") +```bash +pre-commit run --show-diff-on-failure --color=always --all-files r ``` -You can automatically change the formatting of the code in the package using the [styler](https://styler.r-lib.org/) package. - -Run the styler locally either via Makefile commands: +See also the following subsections our styling and lint details for R and C++ codes. -```bash -make style # (for only the files changed) -make style-all # (for all files) -``` +### R code -or in R: +The R code in the package follows [the tidyverse style](https://style.tidyverse.org/). On PR submission (and on pushes) our CI will run linting and will flag possible errors on the pull request with annotations. -```r -# note the file that should not be styled -styler::style_pkg(exclude_files = c("data-raw/codegen.R")) -``` +You can automatically change the formatting of the code in the package using the [styler](https://styler.r-lib.org/) package. Review Comment: We'll use Air in the future. It's tracked by https://github.com/apache/arrow/issues/46592 . -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
