这是indexloc提供的服务,不要输入任何密码
Skip to content

fix messages #995

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

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions R/messages.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@

message_qtm_empty = function() {
cli::cli_inform(
"{.field [qtm]} nothing to show. Either specify {.arg shp} or {.arg basemap}. Alternatively, switch to view mode with {.code tmap_mode(\"view\")}"
"{.field [qtm()]} nothing to show. Either specify {.arg shp} or {.arg basemap}. Alternatively, switch to view mode with {.code tmap_mode(\"view\")}"

Check warning on line 122 in R/messages.R

View check run for this annotation

Codecov / codecov/patch

R/messages.R#L122

Added line #L122 was not covered by tests
)
}

message_layer_unused_args = function(layer_fun, args) {
cli::cli_inform(c(
"{.field [{layer_fun}]} Argument{ifelse(length(args)>1, 's', '')} {.arg {args}} unknown."
"{.field [{layer_fun}()]} Argument{ifelse(length(args)>1, 's', '')} {.arg {args}} unknown."

Check warning on line 128 in R/messages.R

View check run for this annotation

Codecov / codecov/patch

R/messages.R#L128

Added line #L128 was not covered by tests
))
}
2 changes: 1 addition & 1 deletion R/tm_layers_lines.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ tm_lines = function(col = tm_const(),
}

# unused arguments: typos?
unused = setdiff(names(args), v3_only("tm_lines"))
unused = setdiff(names(args), c(v3_only("tm_lines"), "called_from"))

if (length(unused)) {
message_layer_unused_args(layer_fun, unused)
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_polygons.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ tm_polygons = function(fill = tm_const(),
}

# unused arguments: typos?
unused = setdiff(names(args), v3_only("tm_polygons"))
unused = setdiff(names(args), c(v3_only("tm_polygons"), "called_from"))

if (length(unused)) {
message_layer_unused_args(layer_fun, unused)
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ tm_raster = function(col = tm_vars(),
}

# unused arguments: typos?
unused = setdiff(names(args), v3_only("tm_raster"))
unused = setdiff(names(args), c(v3_only("tm_raster"), "called_from"))

if (length(unused)) {
message_layer_unused_args(layer_fun, unused)
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_rgb.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ tm_rgb = function(col = tm_vars(n = 3, multivariate = TRUE),
}

# unused arguments: typos?
unused = setdiff(names(args), v3_only("tm_rgb"))
unused = setdiff(names(args), c(v3_only("tm_rgb"), "called_from"))

if (length(unused)) {
message_layer_unused_args(layer_fun, unused)
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_symbols.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ tm_symbols = function(size = tm_const(),
}

# unused arguments: typos?
unused = setdiff(names(args), v3_only("tm_symbols"))
unused = setdiff(names(args), c(v3_only("tm_symbols"), "called_from"))

if (length(unused)) {
layer_fun = if ("called_from" %in% names(args)) {
Expand Down
2 changes: 1 addition & 1 deletion R/tm_layers_text.R
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ tm_text = function(text = tm_const(),
}

# unused arguments: typos?
unused = setdiff(names(args), v3_only("tm_text"))
unused = setdiff(names(args), c(v3_only("tm_text"), "called_from"))

if (length(unused)) {
message_layer_unused_args(layer_fun, unused)
Expand Down
Loading