From daf9a9b1f9aa90111da3a301bba079a14ba31b8e Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Mon, 16 Jan 2023 22:07:37 +0100 Subject: [PATCH 1/4] remove mentions of lintr-bot lintr-bot seems to be retired, see https://github.com/r-lib/lintr/pull/1558 --- vignettes/continuous-integration.Rmd | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/vignettes/continuous-integration.Rmd b/vignettes/continuous-integration.Rmd index 0e2f5d1cd..e9d355c94 100644 --- a/vignettes/continuous-integration.Rmd +++ b/vignettes/continuous-integration.Rmd @@ -33,11 +33,11 @@ usethis::use_github_action("lint") This will create a workflow file called `lint.yaml` and place it in the correct location, namely in the `.github/workflows` directory of your repository. This file configures all the steps required to run `lintr::lint_package()` on your package. -[lintr-bot](https://github.com/lintr-bot) will then add comments to the commit or pull request with the lints found and they will also be printed as +Comments to the commit or pull request will be printed as [annotations](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/about-status-checks#types-of-status-checks-on-github) along side the status check on GitHub. -If you want to disable the commenting you can set the environment variable `LINTR_COMMENT_BOT=false`. -Additionally, if you want the builds to produce an error instead of just a warning, you can set the environment variable `LINTR_ERROR_ON_LINT=true`. +If you want the builds to produce an error instead of just a warning, you can set the environment variable `LINTR_ERROR_ON_LINT=true`. +This is set by default in [r-lib/actions](https://github.com/r-lib/actions/)'s `lint.yaml`. 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 @@ -55,9 +55,8 @@ r_github_packages: We recommend running `lintr::lint_package()` as an [after_success step in your build process](#non-failing-lints)] -Just like with GitHub Actions, [lintr-bot](https://github.com/lintr-bot) will then add comments to the commit or pull request with the lints found and -they will also be printed on Travis-CI. -The environment variables `LINTR_COMMENT_BOT` and `LINTR_ERROR_ON_LINT` mentioned for GitHub actions also work with Travis CI builds. +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. ##### Non-failing Lints {#non-failing-lints} @@ -73,7 +72,7 @@ Live example of a package using this setup: ## For projects -You are not limited you using `lintr` for packages -- you can use it in combination with continuous integration for any other project. +You are not limited to using `lintr` for packages -- you can use it in combination with continuous integration for any other project. ### GitHub Actions From 387f908faecdaf4256073acfb9454abd45e3616c Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Mon, 16 Jan 2023 22:17:04 +0100 Subject: [PATCH 2/4] remove reference to lintr-bot w/ travis-ci --- vignettes/continuous-integration.Rmd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vignettes/continuous-integration.Rmd b/vignettes/continuous-integration.Rmd index e9d355c94..ad808903f 100644 --- a/vignettes/continuous-integration.Rmd +++ b/vignettes/continuous-integration.Rmd @@ -67,8 +67,7 @@ after_success: ``` Live example of a package using this setup: -[`hibpwned`](https://github.com/jumpingrivers/HIBPwned/blob/master/.travis.yml), -[lintr-bot commenting on a PR](https://github.com/jumpingrivers/HIBPwned/pull/30). +[`hibpwned`](https://github.com/jumpingrivers/HIBPwned/blob/master/.travis.yml). ## For projects From d5645855ce2484adda1112617486009ebc7fd3d6 Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Tue, 17 Jan 2023 14:34:10 +0100 Subject: [PATCH 3/4] add lint-staged-files.yaml --- vignettes/continuous-integration.Rmd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vignettes/continuous-integration.Rmd b/vignettes/continuous-integration.Rmd index ad808903f..82da335c8 100644 --- a/vignettes/continuous-integration.Rmd +++ b/vignettes/continuous-integration.Rmd @@ -33,11 +33,17 @@ usethis::use_github_action("lint") This will create a workflow file called `lint.yaml` and place it in the correct location, namely in the `.github/workflows` directory of your repository. This file configures all the steps required to run `lintr::lint_package()` on your package. +Alternatively you can use the eponymous [`lint-changed-files.yaml`](https://github.com/r-lib/actions/blob/v2-branch/examples/lint-changed-files.yaml) to only lint any changed files: + +```r +usethis::use_github_action("lint-changed-files") +``` + Comments to the commit or pull request will be printed as [annotations](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/about-status-checks#types-of-status-checks-on-github) along side the status check on GitHub. If you want the builds to produce an error instead of just a warning, you can set the environment variable `LINTR_ERROR_ON_LINT=true`. -This is set by default in [r-lib/actions](https://github.com/r-lib/actions/)'s `lint.yaml`. +This is set by default for both [r-lib/actions](https://github.com/r-lib/actions/)'s `lint.yaml` and `lint-changed-files.yaml`. 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 From 852eb20a4add07066582ce9876a115c0717180dc Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Tue, 17 Jan 2023 14:38:04 +0100 Subject: [PATCH 4/4] remove hibpwnd reference from travis-ci section --- vignettes/continuous-integration.Rmd | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/vignettes/continuous-integration.Rmd b/vignettes/continuous-integration.Rmd index 82da335c8..e1eb33ed1 100644 --- a/vignettes/continuous-integration.Rmd +++ b/vignettes/continuous-integration.Rmd @@ -59,12 +59,7 @@ r_github_packages: - r-lib/lintr ``` -We recommend running `lintr::lint_package()` as an [after_success step in your build process](#non-failing-lints)] - -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. - -##### Non-failing Lints {#non-failing-lints} +We recommend running `lintr::lint_package()` as an after_success step in your build process: ``` yaml after_success: @@ -72,8 +67,8 @@ after_success: - Rscript -e 'lintr::lint_package()' ``` -Live example of a package using this setup: -[`hibpwned`](https://github.com/jumpingrivers/HIBPwned/blob/master/.travis.yml). +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