Skip to content

Commit

Permalink
Merge pull request #587 from Appsilon/release-1.8.0
Browse files Browse the repository at this point in the history
Release 1.8.0
  • Loading branch information
jakubnowicki authored Jun 5, 2024
2 parents d4d1bc7 + b3ab9a4 commit dd901d0
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 16 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rhino
Title: A Framework for Enterprise Shiny Applications
Version: 1.7.0.9002
Version: 1.8.0
Authors@R:
c(
person("Kamil", "Żyła", role = c("aut", "cre"), email = "[email protected]"),
Expand Down
19 changes: 6 additions & 13 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
# rhino (development version)

1. All linter functions migrated to `box.linters`. New rhino projects will be configured to use linters from `box.linters`. To migrate an existing rhino project, run:
```r
box.linters::use_box_lintr(type = "rhino")
```
2. Update GitHub Workflow template triggers. To update your workflow run:
```r
file.copy(
system.file("templates", "github_ci", "dot.github", "workflows", "rhino-test.yml", package = "rhino"),
file.path(".github", "workflows", "rhino-test.yml")
)
```
# rhino 1.8.0

1. All linter functions migrated to `box.linters`. New rhino projects will be configured to use linters from `box.linters`.
2. Updated GitHub Workflow template triggers.

See _[How-to: Rhino 1.8 Migration Guide](https://appsilon.github.io/rhino/articles/how-to/migrate-1-8.html)_

# [rhino 1.7.0](https://github.com/Appsilon/rhino/releases/tag/v1.7.0)

Expand Down
5 changes: 4 additions & 1 deletion R/tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ check_paths <- function(paths) {
}
}

# nolint start: line_length_linter
#' Lint R
#'
#' Uses the `{lintr}` package to check all R sources in the `app` and `tests/testthat` directories
#' for style errors.
#'
#' The linter rules can be adjusted in the `.lintr` file.
#' The linter rules can be [adjusted](https://lintr.r-lib.org/articles/lintr.html#configuring-linters)
#' in the `.lintr` file.
#'
#' You can set the maximum number of accepted style errors
#' with the `legacy_max_lint_r_errors` option in `rhino.yml`.
Expand All @@ -83,6 +85,7 @@ check_paths <- function(paths) {
#' @return None. This function is called for side effects.
#'
#' @export
# nolint end
lint_r <- function(paths = NULL) {
if (is.null(paths)) {
paths <- c("app", "tests/testthat")
Expand Down
3 changes: 2 additions & 1 deletion man/lint_r.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ navbar:
href: articles/how-to/migrate-1-6.html
- text: Migration to Rhino 1.7
href: articles/how-to/migrate-1-7.html
- text: Migration to Rhino 1.8
href: articles/how-to/migrate-1-8.html

faq:
text: FAQ
Expand Down
2 changes: 2 additions & 0 deletions vignettes/explanation/rhino-style-guide.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ These rules are designed to work alongside `tidyverse` conventions, providing cl

For more details on how to use `box::use` statements, see [Explanation: Box modules](https://appsilon.github.io/rhino/articles/explanation/box-modules.html).

For more details on how to configure linter rules in the `.lintr` file, see [Configuring linters](https://lintr.r-lib.org/articles/lintr.html#configuring-linters).

# Explicit Import

For clarity and ease of tracking function origins, avoid using `[...]` for imports. Explicitly declare all packages, modules and functions.
Expand Down
73 changes: 73 additions & 0 deletions vignettes/how-to/migrate-1-8.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: "How-to: Rhino 1.8 Migration Guide"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{How-to: Rhino 1.8 Migration Guide}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

Follow the steps outlined in this guide to migrate your project to Rhino 1.8.
Before starting, ensure your Git working tree is clean, or back up your project if not using Git.

This guide assumes you are migrating from Rhino 1.6 or 1.7.
If you are currently using an older version of Rhino,
please start with
[Rhino 1.6 Migration Guide](https://appsilon.github.io/rhino/articles/how-to/migrate-1-6.html).

# Step 1: Install Rhino 1.8

Use the following command to install Rhino 1.8 and update your `renv.lock` file:

```r
rhino::pkg_install("[email protected]")
```

After the installation, restart your R session to ensure all changes take effect.

# Step 2: Update your linter rules

## Option A: You use `.lintr` provided by Rhino without modifications

Run the following command to replace your `.lintr` file with the new default one provided by Rhino:

```r
box.linters::use_box_lintr(type = "rhino")
```

## Option B: You have customized `.lintr` file

Edit the `.lintr` file in your project so it uses `box.linters::rhino_default_linters` as the default linters:

```r
linters:
linters_with_defaults(
defaults = box.linters::rhino_default_linters,
line_length_linter = lintr::line_length_linter(100) # You can add your custom linters here
)
```

# Step 3: Update GitHub Actions workflow

_Note: This step is only necessary if you are using GitHub Actions in your project._

To update your workflow, run:
```r
file.copy(
system.file("templates", "github_ci", "dot.github", "workflows", "rhino-test.yml", package = "rhino"),
file.path(".github", "workflows", "rhino-test.yml")
)
```

This command will replace the current GitHub Actions workflow with the new Rhino-provided one.
If you have customized your workflow, you will need to manually update it to include the new triggers added to the template.
The changes can be found in [this commit](https://github.com/Appsilon/rhino/commit/8e080655f81865a30af51330cd81f4614d3a7405).

# Step 4: Test your project

Test your project thoroughly to ensure everything works properly after the migration.
In particular, run `rhino::lint_r()` and fix the problems it reports.

If you encounter any issues or have further questions,
don't hesitate to reach out to us via
[GitHub Discussions](https://github.com/Appsilon/rhino/discussions).

0 comments on commit dd901d0

Please sign in to comment.