Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Travis, Jenkins, and Werker CI tools posting GitHub comments #2446

Merged
merged 30 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
301dfd2
start transition
MichaelChirico Nov 12, 2023
1cc7269
Merge branch 'main' into httr-httr2
MichaelChirico Dec 15, 2023
ccda0ea
migrate to httr2
MichaelChirico Dec 15, 2023
30c953d
use ... to handle path
MichaelChirico Dec 15, 2023
91b63f0
Merge branch 'main' into httr-httr2
MichaelChirico Dec 15, 2023
c27bdb0
Merge remote-tracking branch 'origin/httr-httr2' into httr-httr2
MichaelChirico Dec 15, 2023
72421ad
DESCRIPTION edit not needed
MichaelChirico Dec 15, 2023
c85b68e
Merge branch 'main' into httr-httr2
MichaelChirico Dec 15, 2023
71845f2
drop functionality altogether
MichaelChirico Dec 15, 2023
b7a7b26
Update comments.R
MichaelChirico Dec 15, 2023
20d43df
Merge branch 'main' into httr-httr2
MichaelChirico Dec 16, 2023
30a42e2
attempt travis
MichaelChirico Dec 18, 2023
aa14a97
Drop Jenkins,Travis,Wercker support
MichaelChirico Dec 18, 2023
af5194b
deprecation in NEWS
MichaelChirico Dec 18, 2023
3597c48
remove from Collate
MichaelChirico Dec 18, 2023
eeb6c3e
no more test lint
MichaelChirico Dec 18, 2023
45a62b3
Merge branch 'main' into httr-httr2
MichaelChirico Dec 18, 2023
b6df0a2
Merge branch 'main' into httr-httr2
MichaelChirico Dec 19, 2023
e94e23c
Merge remote-tracking branch 'origin/httr-httr2' into httr-httr2
MichaelChirico Dec 19, 2023
3e29a2f
zombie file
MichaelChirico Dec 19, 2023
10cfe68
Merge branch 'main' into httr-httr2
MichaelChirico Dec 20, 2023
0f5587c
Try to see system2 output
MichaelChirico Dec 20, 2023
508548b
lintr not available??
MichaelChirico Dec 25, 2023
05873e2
try forcing matched .libPaths()?
MichaelChirico Dec 25, 2023
49855d6
typo
MichaelChirico Dec 25, 2023
12ead33
ignore .libPaths() output
MichaelChirico Dec 25, 2023
dc63ba0
try find.package() instead
MichaelChirico Dec 25, 2023
64fdd68
skip
MichaelChirico Dec 25, 2023
6347668
actually 3.6.3
MichaelChirico Dec 25, 2023
bf9a995
Merge branch 'main' into httr-httr2
MichaelChirico Feb 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Imports:
Suggests:
bookdown,
cli,
httr (>= 1.2.1),
jsonlite,
patrick (>= 0.2.0),
rlang,
Expand Down Expand Up @@ -76,7 +75,6 @@ Collate:
'class_equals_linter.R'
'commas_linter.R'
'commented_code_linter.R'
'comments.R'
'comparison_negation_linter.R'
'condition_call_linter.R'
'condition_message_linter.R'
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* 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.
* `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)`.
* `unnecessary_nested_if_linter()` is deprecated and subsumed into the new/more general `unnecessary_nesting_linter()`.
* 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.

## Bug fixes

Expand Down
116 changes: 0 additions & 116 deletions R/comments.R

This file was deleted.

12 changes: 0 additions & 12 deletions R/methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@ print.lints <- function(x, ...) {
} else if (in_github_actions()) {
github_actions_log_lints(x, project_dir = github_annotation_project_dir)
} else {
if (in_ci() && settings$comment_bot) {
info <- ci_build_info()

lint_output <- trim_output(
paste0(
collapse = "\n",
capture.output(invisible(lapply(x, markdown, info, ...)))
)
)

github_comment(lint_output, info, ...)
}
lapply(x, print, ...)
}

Expand Down
22 changes: 0 additions & 22 deletions tests/testthat/test-ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,3 @@ test_that("GitHub Actions - linting on error works", {
local_mocked_bindings(quit = function(...) cat("Tried to quit.\n"))
expect_output(print(l), "::warning file", fixed = TRUE)
})

test_that("Printing works for Travis", {
withr::local_envvar(list(GITHUB_ACTIONS = "false", TRAVIS_REPO_SLUG = "test/repo", LINTR_COMMENT_BOT = "true"))
withr::local_options(lintr.rstudio_source_markers = FALSE)
tmp <- withr::local_tempfile(lines = "x <- 1:nrow(y)")

l <- lint(tmp)

local_mocked_bindings(github_comment = function(x, ...) cat(x, "\n"))
expect_output(print(l), "*warning:*", fixed = TRUE)
})

test_that("Printing works for Wercker", {
withr::local_envvar(list(GITHUB_ACTIONS = "false", WERCKER_GIT_BRANCH = "test/repo", LINTR_COMMENT_BOT = "true"))
withr::local_options(lintr.rstudio_source_markers = FALSE)
tmp <- withr::local_tempfile(lines = "x <- 1:nrow(y)")

l <- lint(tmp)

local_mocked_bindings(github_comment = function(x, ...) cat(x, "\n"))
expect_output(print(l), "*warning:*", fixed = TRUE)
})
81 changes: 0 additions & 81 deletions tests/testthat/test-comments.R

This file was deleted.

3 changes: 3 additions & 0 deletions tests/testthat/test-lint_package.R
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ test_that("package using .lintr.R config lints correctly", {
})

test_that("lintr need not be attached for .lintr.R configs to use lintr functions", {
# For some obscure reason, running in the subprocess on this specific version of R
# on Windows stopped working after PR #2446 with 'Package lintr not found'.
if (getRversion() == "3.6.3") skip_on_os("windows")
exprs <- paste(
'options(lintr.linter_file = "lintr_test_config")',
sprintf('lints <- lintr::lint_package("%s")', test_path("dummy_packages", "RConfig")),
Expand Down
21 changes: 0 additions & 21 deletions vignettes/continuous-integration.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,6 @@ Note that this will kill the R process in case of a lint.
If your project is in a subdirectory and you would like to use GitHub Actions annotations, you can set
`options(lintr.github_annotation_project_dir = "path/to/project")` which will make sure that the annotations point to the correct paths.

### Travis CI

If you want to run `lintr` on [Travis-CI](https://www.travis-ci.com/), you will need to have Travis install the package first.
This can be done by adding the following line to your `.travis.yml`

``` yaml
r_github_packages:
- r-lib/lintr
```

We recommend running `lintr::lint_package()` as an after_success step in your build process:

``` yaml
after_success:
- R CMD INSTALL $PKG_TARBALL
- Rscript -e 'lintr::lint_package()'
```

If lints are found in the commit or pull request they will be printed on Travis-CI.
The environment variable `LINTR_ERROR_ON_LINT` mentioned for GitHub actions also works with Travis CI builds.

## For projects

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