Skip to content
Last updated

recheck

Introduction

The recheck block configures the recheck command. It adjusts the rules that the Recheck presets provide, and it sets file excludes and Markdoc parsing.

The block does not accept extends. Add Recheck presets, such as recheck/markdown, to the root extends of redocly.yaml. The block merges on top of the presets that the same file lists in extends. Presets and shared config files merge in extends order, so a preset listed after a shared file overrides the recheck block of that file. An unknown preset name, such as recheck/nope, is a configuration error.

Options

OptionTypeDescription
rulesRules objectRule names mapped to a severity or to a rule object.
excludes[string]File globs that every rule in this block skips. Recheck adds this list to each rule's own excludes.
markdocboolean or Markdoc objectTurn on Markdoc-aware parsing. true is the same as { schema: realm }.

Rules object

Each key is a rule name. Each value is a severity string (off, info, warn, or error) or a rule object. Use a severity string to change the severity of a preset rule or to turn it off.

Rule object

OptionTypeDescription
severitystringREQUIRED. One of off, info, warn, or error.
messagestringThe message that the rule reports. REQUIRED for a scope rule, which uses an assertion such as pattern or metric. A token rule, which uses an assertion such as line-length, takes its default message when the entry has none.
assertionsobjectREQUIRED. The checks that the rule runs. Each assertion type has its own options.
fixbooleanLet --fix apply this rule's fix. Only some assertion types offer a fix.
tags[string]Labels for the --tags option.
descriptionstringA note about the purpose of the rule.
linkstringA URL with more detail about the rule.
scopestring or [string]Where the rule runs: all, heading, sentence, paragraph, code, or raw.
appliesTo[string]File globs that the rule runs on. Default value is every Markdown file.
excludes[string]File globs that the rule skips.
exceptionsExceptions objectFiles and lines that the rule does not check.

Exceptions object

OptionTypeDescription
files[string]File globs that the rule skips.
lines[string]Line patterns that the rule skips.

Markdoc object

OptionTypeDescription
schemarealm or falseREQUIRED. realm validates tags against the built-in Realm schema. false parses and pairs Markdoc tags without a schema check.
extendExtend objectAdd your own tags on top of the chosen schema.

Extend object

OptionTypeDescription
tagsobjectTag names mapped to tag schemas. Set tags, tagsFile, or both.
tagsFilestringPath to a YAML file that maps tag names to tag schemas.

Example

extends:
  - recheck/markdown
recheck:
  excludes:
    - CHANGELOG.md
  markdoc: true
  rules:
    recheck/line-length: off
    recheck/readability-floor:
      severity: warn
      message: 'Readability (%s) is %s; expected between %s and %s.'
      assertions:
        metric:
          formula: flesch-reading-ease
          min: 30

This config adds the recheck/markdown preset in the root extends. The recheck block skips CHANGELOG.md, turns on Markdoc-aware parsing, turns off one rule, and adds one rule.

  • extends lists the Recheck presets at the root of redocly.yaml.
  • rules configures API linting rules, which are separate from recheck.rules.

Resources