Skip to content

Commit 8392c0b

Browse files
Drop support for Travis, Jenkins, and Werker CI tools posting GitHub comments (#2446)
* start transition * migrate to httr2 * use ... to handle path * DESCRIPTION edit not needed * drop functionality altogether * Update comments.R * attempt travis * Drop Jenkins,Travis,Wercker support * deprecation in NEWS * remove from Collate * no more test lint * zombie file * Try to see system2 output * lintr not available?? * try forcing matched .libPaths()? * typo * ignore .libPaths() output * try find.package() instead * skip * actually 3.6.3
1 parent d7c4c5b commit 8392c0b

File tree

8 files changed

+4
-254
lines changed

8 files changed

+4
-254
lines changed

DESCRIPTION

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Imports:
3737
Suggests:
3838
bookdown,
3939
cli,
40-
httr (>= 1.2.1),
4140
jsonlite,
4241
patrick (>= 0.2.0),
4342
rlang,
@@ -76,7 +75,6 @@ Collate:
7675
'class_equals_linter.R'
7776
'commas_linter.R'
7877
'commented_code_linter.R'
79-
'comments.R'
8078
'comparison_negation_linter.R'
8179
'condition_call_linter.R'
8280
'condition_message_linter.R'

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* Adjusted various lint messages for consistency in readability (#1330, @MichaelChirico). In general, we favor lint messages to be phrased like "Action, reason" to but the "what" piece of the message front-and-center. This may be a breaking change for code that tests the specific phrasing of lints.
1515
* `extraction_operator_linter()` is deprecated. Although switching from `$` to `[[` has some robustness benefits for package code, it can lead to non-idiomatic code in many contexts (e.g. R6 classes, Shiny applications, etc.) (#2409, @IndrajeetPatil). To enable the detection of the `$` operator for extraction through partial matching, use `options(warnPartialMatchDollar = TRUE)`.
1616
* `unnecessary_nested_if_linter()` is deprecated and subsumed into the new/more general `unnecessary_nesting_linter()`.
17+
* Drop support for posting GitHub comments from inside Travis, Wercker, and Jenkins CI tools (spurred by #2148, @MichaelChirico). We rely on GitHub Actions for linting in CI, and don't see any active users relying on these alternatives. We welcome and encourage community contributions to get support for different CI system going again.
1718

1819
## Bug fixes
1920

R/comments.R

Lines changed: 0 additions & 116 deletions
This file was deleted.

R/methods.R

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,6 @@ print.lints <- function(x, ...) {
9595
} else if (in_github_actions()) {
9696
github_actions_log_lints(x, project_dir = github_annotation_project_dir)
9797
} else {
98-
if (in_ci() && settings$comment_bot) {
99-
info <- ci_build_info()
100-
101-
lint_output <- trim_output(
102-
paste0(
103-
collapse = "\n",
104-
capture.output(invisible(lapply(x, markdown, info, ...)))
105-
)
106-
)
107-
108-
github_comment(lint_output, info, ...)
109-
}
11098
lapply(x, print, ...)
11199
}
112100

tests/testthat/test-ci.R

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,3 @@ test_that("GitHub Actions - linting on error works", {
3737
local_mocked_bindings(quit = function(...) cat("Tried to quit.\n"))
3838
expect_output(print(l), "::warning file", fixed = TRUE)
3939
})
40-
41-
test_that("Printing works for Travis", {
42-
withr::local_envvar(list(GITHUB_ACTIONS = "false", TRAVIS_REPO_SLUG = "test/repo", LINTR_COMMENT_BOT = "true"))
43-
withr::local_options(lintr.rstudio_source_markers = FALSE)
44-
tmp <- withr::local_tempfile(lines = "x <- 1:nrow(y)")
45-
46-
l <- lint(tmp)
47-
48-
local_mocked_bindings(github_comment = function(x, ...) cat(x, "\n"))
49-
expect_output(print(l), "*warning:*", fixed = TRUE)
50-
})
51-
52-
test_that("Printing works for Wercker", {
53-
withr::local_envvar(list(GITHUB_ACTIONS = "false", WERCKER_GIT_BRANCH = "test/repo", LINTR_COMMENT_BOT = "true"))
54-
withr::local_options(lintr.rstudio_source_markers = FALSE)
55-
tmp <- withr::local_tempfile(lines = "x <- 1:nrow(y)")
56-
57-
l <- lint(tmp)
58-
59-
local_mocked_bindings(github_comment = function(x, ...) cat(x, "\n"))
60-
expect_output(print(l), "*warning:*", fixed = TRUE)
61-
})

tests/testthat/test-comments.R

Lines changed: 0 additions & 81 deletions
This file was deleted.

tests/testthat/test-lint_package.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ test_that("package using .lintr.R config lints correctly", {
231231
})
232232

233233
test_that("lintr need not be attached for .lintr.R configs to use lintr functions", {
234+
# For some obscure reason, running in the subprocess on this specific version of R
235+
# on Windows stopped working after PR #2446 with 'Package lintr not found'.
236+
if (getRversion() == "3.6.3") skip_on_os("windows")
234237
exprs <- paste(
235238
'options(lintr.linter_file = "lintr_test_config")',
236239
sprintf('lints <- lintr::lint_package("%s")', test_path("dummy_packages", "RConfig")),

vignettes/continuous-integration.Rmd

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,6 @@ Note that this will kill the R process in case of a lint.
5151
If your project is in a subdirectory and you would like to use GitHub Actions annotations, you can set
5252
`options(lintr.github_annotation_project_dir = "path/to/project")` which will make sure that the annotations point to the correct paths.
5353

54-
### Travis CI
55-
56-
If you want to run `lintr` on [Travis-CI](https://www.travis-ci.com/), you will need to have Travis install the package first.
57-
This can be done by adding the following line to your `.travis.yml`
58-
59-
``` yaml
60-
r_github_packages:
61-
- r-lib/lintr
62-
```
63-
64-
We recommend running `lintr::lint_package()` as an after_success step in your build process:
65-
66-
``` yaml
67-
after_success:
68-
- R CMD INSTALL $PKG_TARBALL
69-
- Rscript -e 'lintr::lint_package()'
70-
```
71-
72-
If lints are found in the commit or pull request they will be printed on Travis-CI.
73-
The environment variable `LINTR_ERROR_ON_LINT` mentioned for GitHub actions also works with Travis CI builds.
74-
7554
## For projects
7655

7756
You are not limited to using `lintr` for packages -- you can use it in combination with continuous integration for any other project.

0 commit comments

Comments
 (0)