-
-
Notifications
You must be signed in to change notification settings - Fork 207
chore: fix with {flir} 💅 #1871
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
base: main
Are you sure you want to change the base?
chore: fix with {flir} 💅 #1871
Conversation
@@ -805,7 +805,7 @@ print.igraphHRG <- function(x, type = c("auto", "tree", "plain"), | |||
level = 3, ...) { | |||
type <- igraph.match.arg(type) | |||
if (type == "auto") { | |||
type <- if (length(x$left <= 100)) "tree" else "plain" | |||
type <- if (length(x$left) <= 100) "tree" else "plain" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouch this is probably wrong
@@ -1338,7 +1338,7 @@ print.igraph.vs <- function(x, | |||
":\n" | |||
cat(title) | |||
|
|||
if (is_single_index(x) && !is.null(graph) && length(vertex_attr_names(graph) > 0)) { | |||
if (is_single_index(x) && !is.null(graph) && length(vertex_attr_names(graph)) > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check this as well
@@ -599,7 +599,7 @@ simple_vs_index <- function(x, i, na_ok = FALSE) { | |||
on.exit(.Call(R_igraph_finalizer)) | |||
tmp <- .Call( | |||
R_igraph_vs_adj, graph, x, as_igraph_es(graph, e) - 1, | |||
as.numeric(3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might actually be important here, check others in this commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR applies automated stylistic updates from the {flir}
linter across the codebase to improve consistency and leverage newer R primitives.
- Replaced
rep(..., length.out = ...)
withrep_len(...)
for concise vector recycling. - Swapped
any(is.na(x))
/any(!is.na(x))
patterns withanyNA(x)
/!all(is.na(x))
. - Used
lengths()
instead ofsapply(..., length)
andseq_len()
/seq_along()
over1:n
.
Reviewed Changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
R/plot.common.R | rep → rep_len, anyNA pattern |
R/plot.R | rep → rep_len, numeric literals, anyNA |
R/other.R | anyNA replacement |
R/operators.R | anyDuplicated, !all, inherits → inherits, rep_len replacements |
R/make.R | anyNA replacements |
R/layout.R | lengths, seq_len, seq_along, anyNA / !all usage, stopifnot tweaks |
R/iterators.R | anyNA replacements |
R/indexing.R | lengths, anyNA replacements |
R/import-standalone-types-check.R | anyNA replacement |
R/import-standalone-purrr.R | lengths, stopifnot tweaks |
R/hrg.R | seq_len loops, seq_len for height |
R/glet.R | anyNA / !all usage, seq_along loops |
R/games.R | rep_len for list & vector |
R/epi.R | lengths, rep_len |
R/conversion.R | lengths, anyNA replacements |
R/community.R | seq_len, !all usage |
R/cohesive.blocks.R | lengths usage |
R/centrality.R | anyNA / !all usage, rowSums |
R/attributes.R | lengths, anyNA / anyDuplicated usage |
R/aaa-auto.R | anyNA / !all usage |
We can re-create the whole PR during the hackathon so you two will see how fast flir is @krlmlr @schochastics 😉 |
I'm not sure we need distinct PRs. 👀
Easy to re-recreate: