Skip to content

Use cli package for warnings and messages, drop assertthat #163

Description

@peterdesmet

Rather than constructing glue messages, use the cli package to format messages/formats: https://cli.r-lib.org/ While doing so:

  • Drop use of assertthat
  • Use error classes rather than always testing on the returned error message

add_resource()

  • assert: valid resource name
  • assert: already has that resource name
  • assert: data must be dataframe or path
  • assert: all arguments must be named
  • assert: conflicting properties

check_package(): #165

  • assert: has resources and directory
  • assert: resources is list, directory is char
  • assert: all resources have a name

check_path(): #164

  • assert: absolute path
  • assert: relative parent path
  • assert: file exists at url
  • assert: file exists at path

check_schema():

  • assert: schema must be a list with property fields
  • assert: All fields in schema must have property name.
  • assert: All fields in schema must have valid type.
  • assert: data must be a data frame containing data.
  • assert: Field names in schema must match column names in data

create_schema()

  • assert: data must be a data frame containing data.

get_resource()

  • assert: is known resource name
  • assert: resource has path or data

get_schema()

  • assert: is tabular resource
  • assert: has schema

read_package()

  • assert: file is character
  • assert: descriptor has resources
  • message: give credit

read_resource()

  • assert: can't find column
  • assert: fields must have name

write_package()

  • assert: package must have resources

write_resource()

  • message: downloading file

overall

  • Remove assertthat dependency
  • Remove glue dependency
  • All conditions use || or &&
  • Make use of the words valid and invalid rather than correct and incorrect in tests
  • Update NEWS.md
  • Create new version

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependencyCaused by or related to a dependencyenhancementNew feature or requestfunction:accessorAccessor functions schema(), resource(), resource_names()function:add/removeFunctions add_resource(), remove_resource()function:checkFunctions check_package(), check_schema(), check_path(), check_data()function:read_packageFunction read_package()function:read_resourceFunction read_resource()function:write_packageFunction write_package()refactor

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions