Skip to content

Commit

Permalink
lintr, rm NoSuggest Check
Browse files Browse the repository at this point in the history
  • Loading branch information
trafficonese committed Sep 1, 2024
1 parent 9fd266a commit 3f6c1ba
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 76 deletions.
60 changes: 0 additions & 60 deletions .github/workflows/Check-NoSugests.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion R/wms.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ wmsDependency <- function() {
#' single-tile/untiled/nontiled layers, shared WMS sources, and
#' \bold{GetFeatureInfo}-powered identify.
#'
#' You can also use \bold{CQL-Filters} by appending a string to the \code{'baseUrl'}.
#' You can also use \bold{CQL-Filters} by appending a string
#' to the \code{'baseUrl'}.
#'
#' Something like \code{'http://server/wms?cql_filter=attribute=value'}
#'
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
[![](https://cranlogs.r-pkg.org/badges/grand-total/leaflet.extras2)](https://cran.rstudio.com/web/packages/leaflet.extras2/index.html)
[![](https://cranlogs.r-pkg.org/badges/last-month/leaflet.extras2?color=blue)](https://cran.r-project.org/package=leaflet.extras2)
[![Codecov test coverage](https://codecov.io/gh/trafficonese/leaflet.extras2/branch/master/graph/badge.svg)](https://app.codecov.io/gh/trafficonese/leaflet.extras2?branch=master)
[![R-CMD-check](https://github.com/trafficonese/leaflet.extras2/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/trafficonese/leaflet.extras2/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The goal of `leaflet.extras2` package is to provide extra functionality to the [leaflet](https://cran.r-project.org/package=leaflet) and [leaflet.extras](https://github.com/trafficonese/leaflet.extras) R packages using various leaflet plugins.
Expand All @@ -33,7 +32,7 @@ If you need a plugin that is not already implemented create an [issue](https://g

- [Ant Path](https://github.com/rubenspgcavalcante/leaflet-ant-path)
- [Arrowheads](https://github.com/slutske22/leaflet-arrowheads)
- [ClusterCharts](https://gist.github.com/gisminister/10001728)
- [ClusterCharts-D3](https://gist.github.com/gisminister/10001728)
- [Contextmenu](https://github.com/aratcliffe/Leaflet.contextmenu)
- [DivIcon](https://leafletjs.com/reference.html#divicon)
- [Easy Print](https://github.com/rowanwins/leaflet-easyPrint)
Expand Down
9 changes: 6 additions & 3 deletions tests/testthat/test-contextmenu.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ test_that("contextmenu", {
contextmenuWidth = 200,
contextmenuItems =
context_mapmenuItems(
context_menuItem("Zoom Out", "function(e) {this.zoomOut()}", disabled = FALSE),
context_menuItem("Zoom Out", "function(e) {this.zoomOut()}",
disabled = FALSE),
"-",
context_menuItem("Zoom In", "function(e) {this.zoomIn()}")
)
Expand Down Expand Up @@ -42,14 +43,16 @@ test_that("contextmenu", {
m$x$calls[[length(m$x$calls)]]$method,
"showContextmenu"
)
expect_true(all(colnames(m$x$calls[[length(m$x$calls)]]$args[[1]]) %in% c("lng", "lat")))
expect_true(all(
colnames(m$x$calls[[length(m$x$calls)]]$args[[1]]) %in% c("lng", "lat")))

m <- m %>% showContextmenu(lat = 49.79433, lng = 11.50941)
expect_equal(
m$x$calls[[length(m$x$calls)]]$method,
"showContextmenu"
)
expect_true(all(colnames(m$x$calls[[length(m$x$calls)]]$args[[1]]) %in% c("lng", "lat")))
expect_true(all(
colnames(m$x$calls[[length(m$x$calls)]]$args[[1]]) %in% c("lng", "lat")))

m <- m %>% hideContextmenu()
expect_equal(
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-heightgraph.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ data <- structure(
)
),
row.names = 4L, class = c("sf", "data.frame"), sf_column = "geometry",
agr = structure(c(Name = NA_integer_, MaxWind = NA_integer_, MinPress = NA_integer_),
agr = structure(c(Name = NA_integer_,
MaxWind = NA_integer_, MinPress = NA_integer_),
levels = c("constant", "aggregate", "identity"), class = "factor"
)
)
Expand Down
9 changes: 7 additions & 2 deletions tests/testthat/test-playback.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,15 @@ test_that("playback", {
structure(c(11.5772056036448, 49.9436206656224), class = c("XY", "POINT", "sfg"))
),
precision = 0,
bbox = structure(c(xmin = 11.5772056036448, ymin = 49.9434124224934, xmax = 11.5779536762059, ymax = 49.9447628006851),
bbox = structure(c(xmin = 11.5772056036448,
ymin = 49.9434124224934,
xmax = 11.5779536762059,
ymax = 49.9447628006851),
class = "bbox"
),
crs = structure(list(epsg = 4326L, proj4string = "+proj=longlat +datum=WGS84 +no_defs"), class = "crs"),
crs = structure(list(
epsg = 4326L,
proj4string = "+proj=longlat +datum=WGS84 +no_defs"), class = "crs"),
n_empty = 0L, class = c("sfc_POINT", "sfc"), ids = 100L
)
),
Expand Down
9 changes: 6 additions & 3 deletions tests/testthat/test-sidebar.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ test_that("sidebar-error", {
expect_error(
sidebar_tabs(
list(tags$i(class = "person"), tags$i(class = "person")),
sidebar_pane(id = "home_id", icon = tags$i(class = "person"), tagList()),
sidebar_pane(id = "profile_id", icon = tags$i(class = "person"), tagList()),
sidebar_pane(id = "messages_id", icon = tags$i(class = "person"), tagList())
sidebar_pane(id = "home_id",
icon = tags$i(class = "person"), tagList()),
sidebar_pane(id = "profile_id",
icon = tags$i(class = "person"), tagList()),
sidebar_pane(id = "messages_id",
icon = tags$i(class = "person"), tagList())
)
)
})
3 changes: 2 additions & 1 deletion tests/testthat/test-sidebyside.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ test_that("sidebyside", {
data = breweries91[1:15, ], color = "blue", group = "blue",
options = pathOptions(pane = "left")
) %>%
addCircleMarkers(data = breweries91[15:20, ], color = "yellow", group = "yellow") %>%
addCircleMarkers(data = breweries91[15:20, ],
color = "yellow", group = "yellow") %>%
addCircleMarkers(
data = breweries91[15:30, ], color = "red", group = "red",
options = pathOptions(pane = "right")
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-spin.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ test_that("spin", {
expect_false(m$x$calls[[length(m$x$calls)]]$args[[1]])

m <- m %>% startSpinner(options = list("lines" = 7, "width" = 12))
expect_equal(m$x$calls[[length(m$x$calls)]]$args[[2]], list("lines" = 7, "width" = 12))
expect_equal(m$x$calls[[length(m$x$calls)]]$args[[2]],
list("lines" = 7, "width" = 12))
})
3 changes: 2 additions & 1 deletion tests/testthat/test-tangram.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
test_that("tangram", {
scene <- system.file("examples/tangram/www/scene.yaml", package = "leaflet.extras2")
scene <- system.file("examples/tangram/www/scene.yaml",
package = "leaflet.extras2")

m <- leaflet() %>%
addTangram(scene = scene, group = "tangram") %>%
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-wms.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ test_that("wms", {

test_that("wms-error", {
expect_error(leaflet() %>%
addWMS(baseUrl = "https://maps.dwd.de/geoserver/dwd/wms"))
addWMS(baseUrl = "https://maps.dwd.de/geoserver/dwd/wms"))
})

0 comments on commit 3f6c1ba

Please sign in to comment.