Argumentsο
Full Example
contracts:
macros:
- arguments:
- filter:
- name:
include:
- ^\w+\d+\s{1,3}$
- include[_-]this
exclude:
- ^\w+\d+\s{1,3}$
- exclude[_-]this
match_all: true
validations:
- has_type
Filtersο
Filters (or Conditions) for reducing the scope of the contract. You may limit the number of arguments processed by the rules of this contract by defining one or more of the following filters.
nameο
Filter arguments based on their names.
Schema
name:
include:
default: []
description: Patterns to match against for values to include
items:
type: string
type: array
exclude:
default: []
description: Patterns to match against for values to exclude
items:
type: string
type: array
match_all:
default: false
description: When True, all given patterns must match to be considered a match
for either pattern type
type: boolean
Example
name:
include: .*i\s+am\s+a\s+regex\s+pattern.*
exclude: .*i\s+am\s+a\s+regex\s+pattern.*
match_all: false
You may also define the parameters for include
directly on the definition like below.
name: .*i\s+am\s+a\s+regex\s+pattern.*
Validationsο
Validations (or Terms) to apply to the resources of this contract. These enforce certain standards that must be followed in order for the contract to be fulfilled.
has_descriptionο
Check whether the arguments have descriptions defined in their properties.
Note
This term does not need further configuration. Simply define the termβs name as an item in your configuration.
has_typeο
Check whether macro arguments have a data type configured in their properties.
Note
This term does not need further configuration. Simply define the termβs name as an item in your configuration.