From 3cbf443ee669df433c5ca0e7871f7c05d6dbd2a6 Mon Sep 17 00:00:00 2001 From: ssube Date: Sat, 9 Nov 2019 22:48:15 -0600 Subject: [PATCH] fix(docs): add rule options to readme --- Makefile | 1 + README.md | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 066b44d..f78b750 100755 --- a/Makefile +++ b/Makefile @@ -97,6 +97,7 @@ build: build-bundle build-docs build-bundle: node_modules $(NODE_BIN)/rollup --config $(CONFIG_PATH)/rollup.js sed -i '1s;^;#! /usr/bin/env node\n\n;' $(TARGET_PATH)/index.js + chmod ug+x $(TARGET_PATH)/index.js build-docs: ## generate html docs $(NODE_BIN)/api-extractor run --config $(CONFIG_PATH)/api-extractor.json --local -v diff --git a/README.md b/README.md index 9aff5fe..c0f322f 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ supports multiple documents per stream or file, inserting defaults, and other ma - [List Mode](#list-mode) - [Rules](#rules) - [Enabling Rules](#enabling-rules) + - [Loading Rules](#loading-rules) - [Validate Rules](#validate-rules) - [License](#license) @@ -326,6 +327,16 @@ To enable a group of rules by level, `--include-level warn`. To enable a group of rules by tag, `--include-tag foo`. +#### Loading Rules + +Rules can be loaded from a file, module, or path. + +To load a file by name, `--rule-file foo.yml`. This will accept any extension. + +To load a module, `--rule-module foo`. The required module exports [are documented here](./docs/rules.md#from-module). + +To load a path, `--rule-path foo/`. This will recursively load any files matching `*.+(json|yaml|yml)`. + #### Validate Rules To validate the rules in the `rules/` directory using the meta-rules: