Skip to content

chore: Refactor specify_*() #325

Description

@jonthegeek

Most specify_*() functions are lumped into R/specify_cls.R, with comment tags such as # chr ---- to divide out class-specific functions.

  1. See if the specify_*() and specify_*_scalar() functions can be further abstracted without breaking any tests, since their signatures are very similar. I imagine a situation where we pass the specify_* function (eg specify_chr) to a constructor (a tweaked .specify_cls(), probably), and that function figures out which arguments are specifically set. We might need to simplify the signatures of the specify_*() functions to make this work; I can imagine changing their specific arguments to ... and documenting with @inheritDotParams, but I'd rather include all the arguments explicitly, in part because that makes auto-suggestions easier to use.
  2. Once the structure of the stabilizers is "finalized" and all tests still pass, split each class section off into a R/stabilize_*.R file (and split its tests to a corresponding test file). Ensure that each of these new files has 100% file-level test coverage, and that the helpers that remain behind in R/stabilize_cls.R also have 100% file-level test coverage in their own test file.

Only include a NEWS bullet if we end up having to change the specify_*() arguments to ...; otherwise this should be invisible to users. DO add this issue number to the issue tags in tests, though (eg, ".specify_cls builds the expected function with no args (#150)" becomes ".specify_cls builds the expected function with no args (#150, #325)").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions