Skip to content

Idempotency and ergonomics sweep for the stable core (addresses #40) #73

Description

@larnsce

Systemic rule from the 2026-07 review: every function that rewrites user-owned files (DESCRIPTION, README.Rmd, R/*.R docs, _pkgdown.yml, .gitignore, CITATION.cff) follows read-merge-write and is safe to re-run, because the openwashdata workflow explicitly re-runs these functions on packages people have hand-edited.

Tasks:

  • setup_website(): idempotent handling of an existing _pkgdown.yml so the guide's "answer No when prompted to preserve styling" instruction becomes unnecessary (a step whose docs warn you to answer a prompt correctly should not prompt)
  • setup_website(): do not crash when .gitignore is missing (R/setup_website.R:52-55 readLines errors on a fresh non-git package)
  • inst/templates/_pkgdown.yml: adopt pkgreview's corrected copy in full, not just the url field: Pages URL instead of repo URL, the explanatory comments, AND the multi-dataset reference block (skills/pkgreview-core/references/templates/_pkgdown.yml in openwashdata/pkgreview). Goal: pkgreview's fork reduces to a pointer (its CLAUDE.md rule 4 calls the divergence a defect magnet; cross-repo coherence finding C4)
  • update_citation(): preserve hand-added CITATION.cff fields across regeneration, keywords in particular. pkgreview's standard adds advisory CITATION.cff keywords (Provenance and FAIR light: @source, README provenance and downloads, CITATION.cff keywords, Zenodo record prompt pkgreview#35) and already warns they must be re-verified after every update_citation() call because cffr regenerates the file wholesale; merge instead of wiping so that manual step disappears (cross-repo coherence finding B1; the canonical keyword mapping is settled in Metadata design decision: canonical sources and field mappings (resolves #47) #67)
  • setup_roxygen() re-run: preserve user-written roxygen below the @Format block instead of silently deleting it, and error clearly when an existing file has no @Format line (currently an unbounded while loop crash); closes the actionable half of Add possibility to overwrite existing .R roxygen documentation file using setup_roxygen() #40, whose documentation half is already largely addressed
  • setup_dictionary(): correct variable_type for multi-class columns (POSIXct, ordered factors produce garbage like c("POSIXct", "POSIXt") today); groundwork for Feature request for labelled data #20
  • load_object(): error informatively on multi-object .rda files and non-rda files in data/ instead of documenting the alphabetically first object or crashing opaquely

Acceptance: running the full core sequence twice in a row on a fixture package produces zero diff and zero data loss; a CITATION.cff with hand-added keywords keeps them through update_citation().

Milestone: v1.1.0 (set manually, see the milestone setup issue).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions