This is an automated email from the ASF dual-hosted git repository.

npr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 241c8e6242 ARROW-16900: [R] Upgrade lintr (#13432)
241c8e6242 is described below

commit 241c8e62420422224530e4a9ea13661ca78a100f
Author: Neal Richardson <[email protected]>
AuthorDate: Fri Jun 24 12:13:54 2022 -0400

    ARROW-16900: [R] Upgrade lintr (#13432)
    
    Authored-by: Neal Richardson <[email protected]>
    Signed-off-by: Neal Richardson <[email protected]>
---
 ci/docker/linux-apt-lint.dockerfile | 16 ++--------------
 r/.lintr                            |  6 +++---
 r/lint.sh                           |  2 +-
 r/vignettes/developers/workflow.Rmd |  4 +---
 4 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/ci/docker/linux-apt-lint.dockerfile 
b/ci/docker/linux-apt-lint.dockerfile
index 249072ae32..8a679be2eb 100644
--- a/ci/docker/linux-apt-lint.dockerfile
+++ b/ci/docker/linux-apt-lint.dockerfile
@@ -56,20 +56,8 @@ COPY ci/etc/rprofile /arrow/ci/etc/
 RUN cat /arrow/ci/etc/rprofile >> $(R RHOME)/etc/Rprofile.site
 # Also ensure parallel compilation of C/C++ code
 RUN echo "MAKEFLAGS=-j$(R -s -e 'cat(parallel::detectCores())')" >> $(R 
RHOME)/etc/Renviron.site
-
-
-COPY ci/scripts/r_deps.sh /arrow/ci/scripts/
-COPY r/DESCRIPTION /arrow/r/
-# We need to install Arrow's dependencies in order for lintr's namespace 
searching to work.
-# This could be removed if lintr no longer loads the dependency namespaces 
(see issues/PRs below)
-RUN /arrow/ci/scripts/r_deps.sh /arrow
-# This fork has a number of changes that have PRs and Issues to resolve 
upstream:
-#   https://github.com/jimhester/lintr/pull/843
-#   https://github.com/jimhester/lintr/pull/841
-#   https://github.com/jimhester/lintr/pull/845
-#   https://github.com/jimhester/lintr/issues/842
-#   https://github.com/jimhester/lintr/issues/846
-RUN R -e "remotes::install_github('jonkeane/lintr@arrow-branch')"
+# We don't need arrow's dependencies, only lintr (and its dependencies)
+RUN R -e "install.packages('lintr')"
 
 # Docker linter
 COPY --from=hadolint /bin/hadolint /usr/bin/hadolint
diff --git a/r/.lintr b/r/.lintr
index 0298fd7f99..619339afca 100644
--- a/r/.lintr
+++ b/r/.lintr
@@ -14,7 +14,7 @@ license:  #  Licensed to the Apache Software Foundation (ASF) 
under one
   #  KIND, either express or implied.  See the License for the
   #  specific language governing permissions and limitations
   #  under the License.
-linters: with_defaults(
+linters: linters_with_defaults(
   line_length_linter = line_length_linter(120),
   object_name_linter = NULL,
   # Even with a liberal definition of name styles, some of our names cause 
issues due to `.`s for s3 classes or NA in the name
@@ -22,8 +22,8 @@ linters: with_defaults(
   # object_name_linter = object_name_linter(styles = c("snake_case", 
"camelCase", "CamelCase", "symbols", "dotted.case", "UPPERCASE", "SNAKE_CASE")),
   object_length_linter = object_length_linter(40),
   object_usage_linter = NULL, # R6 methods are flagged,
-  cyclocomp_linter = cyclocomp_linter(26), # TODO: reduce to default of 15
-  open_curly_linter = NULL # styler and lintr conflict on this 
(https://github.com/r-lib/styler/issues/549#issuecomment-537191536)
+  cyclocomp_linter = cyclocomp_linter(26) # TODO: reduce to default of 15
+  # See also https://github.com/r-lib/lintr/issues/804 for cyclocomp issues 
with R6
   )
 exclusions: list(
   "R/arrowExports.R",
diff --git a/r/lint.sh b/r/lint.sh
index 91435e7e01..21e7374733 100755
--- a/r/lint.sh
+++ b/r/lint.sh
@@ -51,4 +51,4 @@ $CPP_BUILD_SUPPORT/run_cpplint.py \
 
 # Run lintr
 R -e "if(!requireNamespace('lintr', quietly=TRUE)){stop('lintr is not 
installed, please install it with R -e \"install.packages(\'lintr\')\"')}"
-NOT_CRAN=true R -e "lintr::lint_package('${SOURCE_DIR}', path_prefix = 'r')"
+NOT_CRAN=true R -e "lintr::lint_package('${SOURCE_DIR}')"
diff --git a/r/vignettes/developers/workflow.Rmd 
b/r/vignettes/developers/workflow.Rmd
index b7e0a27d76..cb88a6af6c 100644
--- a/r/vignettes/developers/workflow.Rmd
+++ b/r/vignettes/developers/workflow.Rmd
@@ -7,7 +7,6 @@ knitr::opts_chunk$set(error = TRUE, eval = FALSE)
 The Arrow R package uses several additional development tools:
 
 * [`lintr`](https://github.com/r-lib/lintr) for code analysis
-  - for the time being, the R package uses a custom version of lintr - 
`jonkeane/lintr@arrow-branch`
 * [`styler`](https://styler.r-lib.org) for code styling
 * [`pkgdown`](https://pkgdown.r-lib.org) for building the website
 * [`roxygen2`](https://roxygen2.r-lib.org) for documenting the package
@@ -16,8 +15,7 @@ The Arrow R package uses several additional development tools:
 You can install all these additional dependencies by running:
 
 ```r
-remotes::install_github("jonkeane/lintr@arrow-branch")
-install.packages(c("styler", "pkgdown", "roxygen2"))
+install.packages(c("lintr", "styler", "pkgdown", "roxygen2"))
 ```
 
 

Reply via email to