docs: zoning rules for arguments around the ellipsis#2757
Open
krlmlr wants to merge 2 commits into
Open
Conversation
This was referenced Jul 26, 2026
Merged
Document which arguments go before and after `...` in CONTRIBUTING.md (section "Argument Order and the Ellipsis"), with pointers from AGENTS.md, tools/README.md, and tools/migrations/README.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
krlmlr
force-pushed
the
claude/optional-args-ellipsis-8oje1a
branch
from
July 26, 2026 16:23
b94d795 to
d58a8f1
Compare
A signature with every argument behind the ellipsis makes the function keyword-only altogether; keep at least the primary argument positional, or drop the ellipsis entirely. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
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.
Central PR: moving optional arguments past the ellipsis, repo-wide
Coordination point for applying the argument-migration pattern
(#2684, #2686, #2743) across all exported functions with optional arguments.
After #2779 landed the registry-split logic on
main, this PR is docs-only:the design rationale in
CONTRIBUTING.md(section Argument Order and the Ellipsis),
with pointers from
AGENTS.md,tools/README.md,and
tools/migrations/README.md.The zoning rules (summary)
Head (before
..., positional):This includes functions with three or more required arguments:
a required argument after
...would be keyword-only but still required,which hides it from the signature and worsens error messages.
is computed, not how:
the objects operated on (
vindegree()),model parameters (
power,minsample_pa()),or a variant-selecting enum (
typeinas_adjacency_matrix()).Tail (after
..., keyword-only): everything else, roughly ordered asinterpretation modifiers (
mode,directed,weights,loops) →output shape (
normalized,names,sparse) →algorithm/tuning (
algorithm,options, callbacks) →deprecated arguments last.
Deliberate deviation from the tidyverse design guide:
dots-after-required
puts
...immediately after the required arguments.We allow a small head of defining optional arguments because idiomatic
positional calls (
degree(g, 1:3),sample_pa(100, 1.5)) are pervasive in20 years of scripts, books, and teaching material; deprecating the idiomatic
form would create warning noise without a safety benefit.
The safety value of keyword-only arguments lies in the long tail of options.
Invariants of the sweep:
(renames remain expressible in the registry via the bare-symbol convention
and can be layered per function family later).
ARG_HANDLE recovery, with a single
lifecycle::deprecate_soft("3.0.0", …).Topic PRs (226 functions, 21 PRs)
Each topic PR is a single commit on
main(the split logic landed via #2779).Not in this sweep (and why)
simplify(),as_undirected(),contract()— already migrated in refactor: snake_case attr-comb options & arguments, soft-deprecate dotted names #2742.erdos.renyi.game(),sample_bipartite(), …) — never changed.E<-,vertex_attr<-, …) —valuehandling is special.shapes(),shape_noclip()) — positional calls are the contract.sample_correlated_gnp_pair()(p~permutation),lattice()(dimvector~dim) —head/recoverable prefix clashes the fix(migrations): guard against head/recoverable prefix clashes #2743 guard rightly rejects; need manual treatment.
mst(),read_graph(),isomorphic(),local_scan(),power.law.fit(),layout_nicely(), …) — their...forwardsto other functions, which the recovery machinery cannot disambiguate;
needs a dedicated design.