Skip to content

Commit 3712a59

Browse files
authored
apacheGH-45536: [Dev][R] Update code to match new linters on lintr=3.2.0 (apache#45556)
### Rationale for this change CI jobs failing with lintr >= 3.2.0 ### What changes are included in this PR? Remove some comments and update some lintr config to ensure compatibility with lintr package version 3.2.0 ### Are these changes tested? Nope ### Are there any user-facing changes? Nope * GitHub Issue: apache#45536 Authored-by: Nic Crane <[email protected]> Signed-off-by: Nic Crane <[email protected]>
1 parent c7a9100 commit 3712a59

File tree

4 files changed

+7
-31
lines changed

4 files changed

+7
-31
lines changed

Diff for: .github/workflows/r.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ jobs:
361361
working-directory: 'r'
362362
extra-packages: |
363363
any::rcmdcheck
364+
any::cyclocomp
364365
# TODO(ARROW-17149): figure out why the GCS tests are hanging on Windows
365366
# - name: Install Google Cloud Storage Testbench
366367
# shell: bash
@@ -405,9 +406,7 @@ jobs:
405406
)
406407
# we use pak for package installation since it is faster, safer and more convenient
407408
pak::local_install()
408-
# Pin the lintr version to avoid breaking changes with newer 3.2.0 version
409-
# See: https://github.com/apache/arrow/pull/45524
410-
pak::pak("[email protected]")
409+
pak::pak("lintr")
411410
lintr::expect_lint_free()
412411
- name: Dump install logs
413412
shell: cmd

Diff for: dev/release/rat_exclude_files.txt

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ csharp/test/Apache.Arrow.Tests/app.config
130130
*.svg
131131
*.devhelp2
132132
*.scss
133+
r/.lintr
133134
r/R/arrowExports.R
134135
r/src/arrowExports.cpp
135136
r/DESCRIPTION

Diff for: r/.lintr

+1-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,8 @@
1-
license: '# Licensed to the Apache Software Foundation (ASF) under one
2-
# or more contributor license agreements. See the NOTICE file
3-
# distributed with this work for additional information
4-
# regarding copyright ownership. The ASF licenses this file
5-
# to you under the Apache License, Version 2.0 (the
6-
# "License"); you may not use this file except in compliance
7-
# with the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing,
12-
# software distributed under the License is distributed on an
13-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14-
# KIND, either express or implied. See the License for the
15-
# specific language governing permissions and limitations
16-
# under the License.'
171
linters: linters_with_defaults(
182
indentation_linter = NULL,
193
line_length_linter = line_length_linter(120),
204
object_name_linter = NULL,
5+
return_linter = NULL,
216
# 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
227
# TODO: figure out if we con contribute to lintr to make these work
238
# object_name_linter = object_name_linter(styles = c("snake_case", "camelCase", "CamelCase", "symbols", "dotted.case", "UPPERCASE", "SNAKE_CASE")),

Diff for: r/tests/testthat/test-dplyr-collapse.R

+3-12
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,11 @@ test_that("Properties of collapsed query", {
142142
summarize(total = sum(int, na.rm = TRUE)) %>%
143143
mutate(extra = total * 5)
144144

145-
# print(tbl %>%
146-
# filter(dbl > 2) %>%
147-
# select(chr, int, lgl) %>%
148-
# mutate(twice = int * 2L) %>%
149-
# group_by(lgl) %>%
150-
# summarize(total = sum(int, na.rm = TRUE)) %>%
151-
# mutate(extra = total * 5))
152-
153-
# # A tibble: 3 × 3
145+
# # A tibble: 2 × 3
154146
# lgl total extra
155147
# <lgl> <int> <dbl>
156-
# 1 FALSE 8 40
157-
# 2 TRUE 8 40
158-
# 3 NA 25 125
148+
# 1 TRUE 5 25
149+
# 2 NA 36 180
159150

160151
# Avoid evaluating just for nrow
161152
expect_identical(dim(q), c(NA_integer_, 3L))

0 commit comments

Comments
 (0)