assert_sha: Display error if not a valid SHA

Description Usage Arguments Value

View source: R/utilities.R

Description

A valid SHA is 40 characters long and only contains the characters 0-9 & a-f.

Usage

1
2
3
4
5
6
7
assert_sha(
  x,
  level = 1,
  msg_level = getOption("msgr.level"),
  msg_types = getOption("msgr.types"),
  log_path = getOption("msgr.log_path")
)

Arguments

x

(any) The object to test.

level

(integer, optional) The level of the message, from 1 to 10. Default: 1.

msg_level

(integer, optional) The maximum level of messages to output. Default: set in the option "msgr.level".

msg_types

(character, optional) The type to write or display. Must either NULL or one or more from "INFO", "WARNING" or "ERROR". Default: set in the option "msgr.types".

log_path

(character, optional) The file path to the text log file. If set to "", then no logs are written. Default: set in the option "msgr.log_path".

Value

If assertion passes then TRUE is returned. This allows you to make multiple assertions separated by &.


ChadGoymer/githapi documentation built on Oct. 22, 2021, 10:56 a.m.