Conversation
Address lint violations from updated gDRstyle rules: - Fix trailing whitespace and blank lines - Replace nrow/ncol with NROW/NCOL - Fix paste_linter (paste0+collapse, toString, strrep, file.path) - Fix seq_linter (seq_along, seq_len) - Refactor cyclocomp_linter violations (extract helper functions) - Fix test linters (yoda, expect_true_false) - Remove undesirable operators (|> pipes)
There was a problem hiding this comment.
Code Review
This pull request introduces Serena configuration and documentation files and performs extensive code cleanup across the package, including whitespace fixes and the adoption of more robust functions like NROW() and toString(). The review feedback identifies two instances where replacing paste0() with paste() without an explicit separator introduces unintended whitespace in dcast formulas and dataset descriptions, which could lead to formatting issues.
| names(dt)))) | ||
| rest_cols <- setdiff(colnames(dt), c(normalization_cols, "normalization_type")) | ||
| dcast_formula <- paste0(paste0(rest_cols, collapse = " + "), " ~ normalization_type") | ||
| dcast_formula <- paste(paste(rest_cols, collapse = " + "), " ~ normalization_type") |
There was a problem hiding this comment.
The change from paste0 to paste with its default separator sep = " " introduces an extra space in the formula string for dcast. While dcast might handle this gracefully, it's more correct to use paste with sep = "" to replicate the behavior of paste0 and avoid unintended whitespace.
dcast_formula <- paste(paste(rest_cols, collapse = " + "), "~ normalization_type", sep = "")| unique_titles <- unique(original_titles) | ||
| if (length(unique_titles) > 0) { | ||
| description <- paste0(description, " Original Titles: [", paste(unique_titles, collapse = " | "), "]") | ||
| description <- paste(description, " Original Titles: [", paste(unique_titles, collapse = " | "), "]") |
There was a problem hiding this comment.
The change from paste0 to paste with its default separator sep = " " introduces an extra space in the description string. To maintain the original behavior without using paste0, you should specify sep = "".
description <- paste(description, " Original Titles: [", paste(unique_titles, collapse = " | "), "]", sep = "")
Description
What changed?
Related JIRA issue: GDR-1014
Why was it changed?
Updated gDRstyle linting rules require compliance across all gDR packages.
Checklist for sustainable code base
Logistic checklist