1
0
Fork 0
salty-dog/rules/salty-dog.yml

80 lines
1.6 KiB
YAML

name: salty-dog-meta
definitions:
rule:
type: object
additionalProperties: false
required:
# metadata
- name
- desc
- level
- tags
# data
- check
properties:
name:
type: string
pattern: "[-a-z0-9]+"
desc:
type: string
minLength: 8
maxLength: 255
level:
type: string
enum:
- debug
- info
- warn
- error
tags:
type: array
items:
type: string
pattern: "[-:a-z0-9]+"
select:
type: string
default: '$'
minLength: 1
filter:
$ref: "http://json-schema.org/draft-07/schema#"
check:
$ref: "http://json-schema.org/draft-07/schema#"
rules:
- name: salty-dog-rule
desc: rules must be complete
level: info
tags:
- important
- salty-dog
select: '$.rules[*]'
check:
$ref: "salty-dog-meta#/definitions/rule"
- name: salty-dog-source
desc: source files must have rules
level: info
tags:
- important
- salty-dog
check:
type: object
additionalProperties: false
required: [name, rules]
properties:
definitions:
type: object
additionalProperties: false
patternProperties:
"[-a-z]+":
type: object
name:
type: string
pattern: "[-a-z]+"
rules:
type: array
minItems: 1
items:
$ref: "salty-dog-meta#/definitions/rule"