Skip to content

Commit

Permalink
Fix lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
annakrystalli committed Oct 24, 2024
1 parent 5ea1a10 commit a4a17d3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions R/parse_file_name.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ validate_filename_contents <- function(file_name, call = rlang::caller_env()) {
invalid_contents <- isFALSE(grepl(pattern, file_name))

if (invalid_contents) {
invalid_char <- stringr::str_remove_all(file_name, "[A-Za-z0-9_-]+") |>

invalid_char <- stringr::str_remove_all(file_name, "[A-Za-z0-9_-]+") |> # nolint: object_usage_linter
strsplit("") |>
unlist() |>
unique()
Expand All @@ -105,12 +106,14 @@ validate_filename_pattern <- function(file_name, file_type,
model_metadata = "^([A-Za-z0-9_]+)-([A-Za-z0-9_]+)$"
)

expected_pattern <- switch(file_type,

expected_pattern <- switch(file_type, # nolint: object_usage_linter
model_output = "[round_id]-[team_abbr]-[model_abbr]",
model_metadata = "[team_abbr]-[model_abbr]"
)

info_url <- switch(file_type,

info_url <- switch(file_type, # nolint: object_usage_linter
model_output = "https://hubverse.io/en/latest/user-guide/model-output.html#directory-structure",
model_metadata = "https://hubverse.io/en/latest/user-guide/model-metadata.html#directory-structure"
)
Expand Down

0 comments on commit a4a17d3

Please sign in to comment.