feat: Modern cli-styled print output #2682
Open
schochastics wants to merge 21 commits into
Open
Conversation
maelle
reviewed
Jun 2, 2026
Contributor
maelle
left a comment
There was a problem hiding this comment.
Awesome to see this PR! Some first comments.
Contributor
Author
|
Need to discuss if we make this default or not. Probably for 3.0.0 a good idea but this will most definitely break a lot of snapshot tests everywhere 😆 |
Contributor
This hasn't stopped others from updating their packages, so I wouldn't feel bad about this. |
krlmlr
reviewed
Jun 4, 2026
krlmlr
reviewed
Jun 4, 2026
Add detailed documentation explaining the dual layout modes (detailed vs compact) for vertex and edge sequence printing, clarify the role of the "single" attribute flag, and replace `identical(full, TRUE)` / `is.logical(full) && full` with `isTRUE(full)` for consistency.
krlmlr
reviewed
Jun 4, 2026
… semantic classes (`.field`, `.cls`) instead of hard-coded colors
…s, edge formatting, and line printing
Add tests/testthat/setup.R pinning `print.style = "classic"` and `print.id = FALSE` for the whole suite, so test output is deterministic and no longer depends on the package defaults (print.style now defaults to "cli"). cli output is exercised explicitly in test-print-cli.R. - Rename test-print.R -> test-print-classic.R (and its snapshot file) to mirror test-print-cli.R, and revert its content to the pre-branch state now that setup.R pins the style. - Drop the now-redundant per-test `print.style = "classic"` settings (test-games.R) and `print.id = FALSE` settings across the suite. test-par.R keeps its print.id settings as it tests the option itself. - Restore the snapshots that had churned to cli output back to classic; regenerate flow.md, where pinning print.id off removes a graph id that the test previously masked via transform. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Make print.igraph.vs() and print.igraph.es() pure dispatchers: guard on `!is_cli_style()` to delegate to the new print_igraph_vs_legacy() / print_igraph_es_legacy() (the former inline classic bodies), and fall through to the cli renderer otherwise. cli is the default style now, so treating it as the main path and legacy as the special case reads more naturally and keeps both branches as named functions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Apply the same dispatch inversion as the vs/es printers to print.igraph() and summary.igraph(): guard on `!is_cli_style()` to delegate to the new print_igraph_legacy() / summary_igraph_legacy() (the former inline classic bodies), and fall through to the cli renderer otherwise. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
all comments should be addressed now 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #1959
Modern printing with cli, currently guarded behind
igraph_options(print.style = "cli")where "classic" is the default old style.