Skip to content

Commit

Permalink
Add missing @summary for data types
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex committed Jun 1, 2022
1 parent b82c762 commit 863b42f
Show file tree
Hide file tree
Showing 42 changed files with 42 additions and 39 deletions.
2 changes: 1 addition & 1 deletion types/absolutepath.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# A strict absolutepath type
# @summary A strict absolutepath type
type Stdlib::Absolutepath = Variant[Stdlib::Windowspath, Stdlib::Unixpath]
2 changes: 1 addition & 1 deletion types/base32.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Type to match base32 String
# @summary Type to match base32 String
type Stdlib::Base32 = Pattern[/\A[a-z2-7]+={,6}\z/, /\A[A-Z2-7]+={,6}\z/]
2 changes: 1 addition & 1 deletion types/base64.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Type to match base64 String
# @summary Type to match base64 String
type Stdlib::Base64 = Pattern[/\A[a-zA-Z0-9\/\+]+={,2}\z/]
2 changes: 1 addition & 1 deletion types/compat/absolute_path.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Emulate the is_absolute_path and validate_absolute_path functions
# @summary Emulate the is_absolute_path and validate_absolute_path functions
#
# The first pattern is originally from is_absolute_path, which had it from 2.7.x's lib/puppet/util.rb Puppet::Util.absolute_path?
# slash = '[\\\\/]'
Expand Down
2 changes: 1 addition & 1 deletion types/compat/array.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Emulate the is_array and validate_array functions
# @summary Emulate the is_array and validate_array functions
type Stdlib::Compat::Array = Array[Any]
2 changes: 1 addition & 1 deletion types/compat/bool.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Emulate the is_bool and validate_bool functions
# @summary Emulate the is_bool and validate_bool functions
type Stdlib::Compat::Bool = Boolean
2 changes: 1 addition & 1 deletion types/compat/float.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Emulate the is_float function
# @summary Emulate the is_float function
# The regex is what's currently used in is_float
# To keep your development moving forward, you can also add a deprecation warning using the Integer type:
#
Expand Down
2 changes: 1 addition & 1 deletion types/compat/hash.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Emulate the is_hash and validate_hash functions
# @summary Emulate the is_hash and validate_hash functions
type Stdlib::Compat::Hash = Hash[Any, Any]
2 changes: 1 addition & 1 deletion types/compat/integer.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Emulate the is_integer and validate_integer functions
# @summary Emulate the is_integer and validate_integer functions
# The regex is what's currently used in is_integer
# validate_numeric also allows range checking, which cannot be mapped to the string parsing inside the function.
# For full backwards compatibility, you will need to keep the validate_numeric call around to catch everything.
Expand Down
2 changes: 1 addition & 1 deletion types/compat/ip_address.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate an IP address
# @summary Validate an IP address
type Stdlib::Compat::Ip_address = Variant[Stdlib::Compat::Ipv4, Stdlib::Compat::Ipv6]
2 changes: 1 addition & 1 deletion types/compat/ipv4.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Emulate the validate_ipv4_address and is_ipv4_address functions
# @summary Emulate the validate_ipv4_address and is_ipv4_address functions
type Stdlib::Compat::Ipv4 = Pattern[/^((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d)))(\/((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))|[0-9]+))?$/] # lint:ignore:140chars
2 changes: 1 addition & 1 deletion types/compat/ipv6.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate an IPv6 address
# @summary Validate an IPv6 address
type Stdlib::Compat::Ipv6 = Pattern[/\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/] # lint:ignore:140chars
2 changes: 1 addition & 1 deletion types/compat/numeric.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Emulate the is_numeric and validate_numeric functions
# @summary Emulate the is_numeric and validate_numeric functions
# The regex is what's currently used in is_numeric
# validate_numeric also allows range checking, which cannot be mapped to the string parsing inside the function.
# For full backwards compatibility, you will need to keep the validate_numeric call around to catch everything.
Expand Down
2 changes: 1 addition & 1 deletion types/compat/re.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Emulate the validate_re function
# @summary Emulate the validate_re function
# validate_re(value, re) translates to Pattern[re], which is not directly mappable as a type alias, but can be specified as Pattern[re].
# Therefore this needs to be translated directly.
2 changes: 1 addition & 1 deletion types/compat/string.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Emulate the is_string and validate_string functions
# @summary Emulate the is_string and validate_string functions
type Stdlib::Compat::String = Optional[String]
2 changes: 1 addition & 1 deletion types/datasize.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate the size of data
# @summary Validate the size of data
type Stdlib::Datasize = Pattern[/^\d+(?i:[kmgt]b?|b)$/]
1 change: 1 addition & 0 deletions types/email.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# @summary Validate an e-mail address
# https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address
# lint:ignore:140chars
type Stdlib::Email = Pattern[/\A[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\z/]
Expand Down
2 changes: 1 addition & 1 deletion types/ensure/file.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate the value of the ensure parameter for a file
# @summary Validate the value of the ensure parameter for a file
type Stdlib::Ensure::File = Enum['present', 'file', 'directory', 'link', 'absent']
2 changes: 1 addition & 1 deletion types/ensure/service.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate the value of the ensure parameter of a service resource
# @summary Validate the value of the ensure parameter of a service resource
type Stdlib::Ensure::Service = Enum['stopped', 'running']
1 change: 1 addition & 0 deletions types/filemode.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# @summary Validate a file mode
# See `man chmod.1` for the regular expression for symbolic mode
# lint:ignore:140chars
type Stdlib::Filemode = Pattern[/\A(([0-7]{1,4})|(([ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=][0-7]+)(,([ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=][0-7]+))*))\z/]
Expand Down
2 changes: 1 addition & 1 deletion types/filesource.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Validate the source parameter on file types
# @summary Validate the source parameter on file types
type Stdlib::Filesource = Variant[
Stdlib::Absolutepath,
Stdlib::HTTPUrl,
Expand Down
2 changes: 1 addition & 1 deletion types/fqdn.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a Fully Qualified Domain Name
# @summary Validate a Fully Qualified Domain Name
type Stdlib::Fqdn = Pattern[/\A(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/]
2 changes: 1 addition & 1 deletion types/host.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a host (FQDN or IP address)
# @summary Validate a host (FQDN or IP address)
type Stdlib::Host = Variant[Stdlib::Fqdn, Stdlib::Compat::Ip_address]
2 changes: 1 addition & 1 deletion types/httpstatus.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a HTTP status code
# @summary Validate a HTTP status code
type Stdlib::HttpStatus = Integer[100, 599]
2 changes: 1 addition & 1 deletion types/httpsurl.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a HTTPS URL
# @summary Validate a HTTPS URL
type Stdlib::HTTPSUrl = Pattern[/(?i:\Ahttps:\/\/.*\z)/]
2 changes: 1 addition & 1 deletion types/httpurl.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a HTTP(S) URL
# @summary Validate a HTTP(S) URL
type Stdlib::HTTPUrl = Pattern[/(?i:\Ahttps?:\/\/.*\z)/]
2 changes: 1 addition & 1 deletion types/ip/address.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Validate an IP address
# @summary Validate an IP address
type Stdlib::IP::Address = Variant[
Stdlib::IP::Address::V4,
Stdlib::IP::Address::V6,
Expand Down
2 changes: 1 addition & 1 deletion types/mac.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# A type for a MAC address
# @summary A type for a MAC address
type Stdlib::MAC = Pattern[
/\A([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})\z/,
/\A([0-9A-Fa-f]{2}[:-]){19}([0-9A-Fa-f]{2})\z/,
Expand Down
2 changes: 1 addition & 1 deletion types/objectstore.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Validate an ObjectStore
# @summary Validate an ObjectStore
type Stdlib::ObjectStore = Variant[
Stdlib::ObjectStore::GSUri,
Stdlib::ObjectStore::S3Uri,
Expand Down
2 changes: 1 addition & 1 deletion types/objectstore/gsuri.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a Google Cloud object store URI
# @summary Validate a Google Cloud object store URI
type Stdlib::ObjectStore::GSUri = Pattern[/\Ags:\/\/.*\z/]
2 changes: 1 addition & 1 deletion types/objectstore/s3uri.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate an Amazon Web Services S3 object store URI
# @summary Validate an Amazon Web Services S3 object store URI
type Stdlib::ObjectStore::S3Uri = Pattern[/\As3:\/\/.*\z/]
2 changes: 1 addition & 1 deletion types/port.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a port number
# @summary Validate a port number
type Stdlib::Port = Integer[0, 65535]
2 changes: 1 addition & 1 deletion types/port/dynamic.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a dynamic port number
# @summary Validate a dynamic port number
type Stdlib::Port::Dynamic = Integer[49152, 65535]
2 changes: 1 addition & 1 deletion types/port/ephemeral.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate an ephemeral port number
# @summary Validate an ephemeral port number
type Stdlib::Port::Ephemeral = Stdlib::Port::Dynamic
2 changes: 1 addition & 1 deletion types/port/privileged.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a priviliged port number
# @summary Validate a priviliged port number
type Stdlib::Port::Privileged = Integer[1, 1023]
2 changes: 1 addition & 1 deletion types/port/registered.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a registered port number
# @summary Validate a registered port number
type Stdlib::Port::Registered = Stdlib::Port::User
2 changes: 1 addition & 1 deletion types/port/unprivileged.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate an unprivileged port number
# @summary Validate an unprivileged port number
type Stdlib::Port::Unprivileged = Integer[1024, 65535]
2 changes: 1 addition & 1 deletion types/port/user.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a port number usable by a user
# @summary Validate a port number usable by a user
type Stdlib::Port::User = Integer[1024, 49151]
2 changes: 1 addition & 1 deletion types/syslogfacility.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Validate a syslog facility
# @summary Validate a syslog facility
type Stdlib::Syslogfacility = Enum[
'kern',
'user',
Expand Down
1 change: 1 addition & 0 deletions types/unixpath.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# @summary Validate a UNIX path
# this regex rejects any path component that does not start with "/" or is NUL
type Stdlib::Unixpath = Pattern[/\A\/([^\n\/\0]+\/*)*\z/]
2 changes: 1 addition & 1 deletion types/windowspath.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a Windows path
# @summary Validate a Windows path
type Stdlib::Windowspath = Pattern[/\A(([a-zA-Z]:[\\\/])|([\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|([\\\/][\\\/]\?[\\\/][^\\\/]+)).*\z/]
2 changes: 1 addition & 1 deletion types/yes_no.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Validate a yes / no value
# @summary Validate a yes / no value
type Stdlib::Yes_no = Pattern[/\A(?i:(yes|no))\z/]

0 comments on commit 863b42f

Please sign in to comment.