1
0
Fork 0
Schema analysis, linting, and transformation for YAML
Go to file
ssube c58a94d703 examples: rename 2019-06-15 20:20:39 -05:00
config feat: make node selectors work 2019-06-15 17:53:07 -05:00
docs docs: basic description of rules 2019-06-15 20:04:20 -05:00
examples examples: rename 2019-06-15 20:20:39 -05:00
rules examples: rename 2019-06-15 20:20:39 -05:00
src feat(config): stream type for bunyan config 2019-06-15 19:35:30 -05:00
vendor/jsonpath-plus feat: make node selectors work 2019-06-15 17:53:07 -05:00
.gitignore docs: include some examples, explicitly state success 2019-06-15 18:56:42 -05:00
.npmignore docs: include some examples, explicitly state success 2019-06-15 18:56:42 -05:00
LICENSE.md docs: add repo url, fix example command 2019-06-15 18:33:50 -05:00
Makefile build: add and document target to validate rules 2019-06-15 19:59:30 -05:00
README.md build: add and document target to validate rules 2019-06-15 19:59:30 -05:00
package.json build: fix main, do not bundle source map or vendor source dir 2019-06-15 18:43:18 -05:00
tsconfig.json feat: project, build, and bundle 2019-06-15 15:20:04 -05:00
yarn.lock feat: make node selectors work 2019-06-15 17:53:07 -05:00

README.md

SALTY DOG

JSON schema analysis, linting, and transformation for YAML, featuring defaults, optional fields, and other good stuff.

Build

> git clone git@github.com:ssube/salty-dog.git
> make

Usage

To validate the rules in the rules/ directory:

> make run-rules
...
{"name":"salty-dog","hostname":"cerberus","pid":29403,"level":30,"msg":"all rules passed","time":"2019-06-16T00:56:55.132Z","v":0}

To validate a file:

> cat rules/examples/kubernetes-require-resources-fail.yml |\
    salty-dog \
      --rules rules/kubernetes.yml \
      --source - \
      --tag important |\
    ./node_modules/.bin/bunyan

[2019-06-15T23:56:04.764Z] ERROR: salty-dog/22211 on cerberus: some rules failed (errors=1)

> cat rules/examples/kubernetes-require-resources-pass.yml |\
    salty-dog \
      --rules rules/kubernetes.yml \
      --source - \
      --tag important |\
    ./node_modules/.bin/bunyan

[2019-06-15T23:53:34.223Z]  INFO: salty-dog/19839 on cerberus: all rules passed

Options

Count

  • Alias: c

Exit with the error count (max of 255) rather than 0 or 1.

Exclude

Excludes take priority over includes: a rule matching some of both will be excluded.

Exclude Level

Exclude rules by log level.

Exclude Name

Exclude rules by name.

Exclude Tag

Exclude rules by tag.

Include

Include Level

Include rules by log level.

Include Name

Include rules by name.

Include Tag
  • Alias: t, tag

Include rules by tag.

Mode

  • Alias: m
  • Default: check

The application mode.

Options:

  • check runs each rule and exits with an indicative status
  • clean runs each rule and updates the source data with any defaults or other changes before running the next rule

Rules

The path to a file containing some rules.

Source

  • Alias: s
  • Default: -

The source file to validate.

Defaults to stdin (-) to work with pipes: cat file.yml | salty --source -