Skip to content

Commit

Permalink
remove mentions of lintr-bot (#1902)
Browse files Browse the repository at this point in the history
* remove mentions of lintr-bot

lintr-bot seems to be retired, see #1558

* remove reference to lintr-bot w/ travis-ci

* add lint-staged-files.yaml

* remove hibpwnd reference from travis-ci section
  • Loading branch information
dpprdan authored Jan 17, 2023
1 parent 492fe4e commit 67da292
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions vignettes/continuous-integration.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.

[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
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 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 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
Expand All @@ -53,27 +59,20 @@ r_github_packages:
- r-lib/lintr
```
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.

##### Non-failing Lints {#non-failing-lints}
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()'
```

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).
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 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

Expand Down

0 comments on commit 67da292

Please sign in to comment.