Skip to contents

Lists the columns of a data dictionary that a documentation file (the README, a data report) never mentions as `column`. Run it in the sanity check: the README documents every table and column, and must follow the schema when a column is added.

Usage

check_documented_columns(dictionary, doc)

Arguments

dictionary

A data dictionary from schema_dictionary(), or a schema (named list of CREATE TABLE statements).

doc

Character. Path of the documentation file (Markdown or Quarto).

Value

A data.table with the table and column not documented; no row when every column is.

Details

The check is deliberately simple: a column counts as documented when its name appears between backticks anywhere in the file. A column name shared by several tables (doc_id) is therefore documented once for all.

Examples

schema <- list(document = "
  CREATE TABLE IF NOT EXISTS document (doc_id VARCHAR, year INTEGER)")
readme <- tempfile(fileext = ".md")
writeLines("| `doc_id` | identifier |", readme)
check_documented_columns(schema, readme)
#> ✔ Every column of the schema is documented in file799806e6d0bea.md.
#> Empty data.table (0 rows and 2 cols): table,column