Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
ffbb993
feat(recheck): add the recheck engine package
adamaltman Sep 2, 2026
2f7eb41
chore(recheck): type-check the engine tests and use the complexity ov…
adamaltman Sep 2, 2026
11cdc30
chore(recheck): narrow the config type and trim the console disables
adamaltman Sep 2, 2026
7b1e8d0
feat(recheck): resolve a redocly.yaml recheck block into engine rules
adamaltman Sep 2, 2026
a7d1607
feat(recheck): expose lint, baseline, readability, and schema actions
adamaltman Sep 3, 2026
8048e10
docs(recheck): describe the engine package and its build
adamaltman Sep 3, 2026
b276c59
docs(recheck): fix a stale reference and tidy the package prose
adamaltman Sep 3, 2026
4a5583a
chore(recheck): changeset for the engine package
adamaltman Sep 3, 2026
51c605d
feat(recheck): accept several roots in the lint, baseline, and readab…
adamaltman Sep 3, 2026
7673c12
fix(recheck): remove standalone-tool references from shipped text
adamaltman Sep 3, 2026
4daf241
chore(recheck): tidy comments, examples, coverage excludes, and the c…
adamaltman Sep 3, 2026
5cab1ed
docs(recheck): make the README consistent about when the command ships
adamaltman Sep 3, 2026
efe989e
chore(recheck): name the CLI command in the last engine strings
adamaltman Sep 3, 2026
197ff5b
docs(recheck): split the contributing note on upstream differences
adamaltman Sep 3, 2026
c66a65e
fix(recheck): resolve code scanning and review findings in the engine
adamaltman Sep 3, 2026
8da2ee1
docs(recheck): apply README wording suggestions from review
adamaltman Sep 3, 2026
ed6b50a
fix(recheck): add the idea admonition type to the Realm Markdoc schema
adamaltman Sep 3, 2026
f53d116
test(recheck): make the outside-root assertion path-separator safe
adamaltman Sep 3, 2026
820dcb8
feat(recheck): add the singleExpanded attribute to accordion-group
adamaltman Sep 11, 2026
0e917b2
fix(recheck): reject a non-object recheck block
adamaltman Sep 18, 2026
d530dbd
chore(recheck): ship the skills directory and drop a config comment
adamaltman Sep 18, 2026
607073b
feat(core): set recheck presets aside in extends and accept the reche…
adamaltman Sep 3, 2026
03d3b02
feat(recheck): add an output channel to the engine logger
adamaltman Sep 3, 2026
51a919e
fix(recheck): send the --stats breakdown to the output channel
adamaltman Sep 3, 2026
c1d5022
feat(cli): wire the recheck engine into the CLI build
adamaltman Sep 3, 2026
8c9a00c
feat(cli): add the redocly recheck command
adamaltman Sep 3, 2026
d00f16e
fix(cli): run the markdoc schema action without the recheck lint config
adamaltman Sep 3, 2026
996c09a
tests(cli): end-to-end coverage for redocly recheck and the recheck b…
adamaltman Sep 3, 2026
599d30f
docs(cli): document redocly recheck and the recheck configuration block
adamaltman Sep 3, 2026
a3935a0
fix(cli): keep sarif stdout clean and correct the recheck docs
adamaltman Sep 3, 2026
f34c1c2
docs(cli): split the recheck sentence in the extends reference
adamaltman Sep 3, 2026
a08ec3c
docs(cli): rewrite the recheck pages in plain language
adamaltman Sep 3, 2026
0d7d5b8
feat(core): pin @redocly/config 0.56.0 and validate the recheck block
adamaltman Sep 3, 2026
3eaced1
refactor(cli): align recheck flags and fallback with lint
adamaltman Sep 8, 2026
2411e0c
chore(cli): drop the inert package rewrite from local-pack.sh
adamaltman Sep 8, 2026
7846022
fix(cli): exit through AbortFlowError, reserve plugin ids, and hide t…
adamaltman Sep 8, 2026
e6ea447
fix(recheck): write the baseline group separator as an escape
adamaltman Sep 8, 2026
30b5f69
refactor(cli): split recheck args, rename toLintOptions, lazy-load th…
adamaltman Sep 18, 2026
92a3ccf
feat(cli): discover .redocly.recheck-baseline.yaml next to redocly.yaml
adamaltman Sep 18, 2026
e2a998e
test(cli): cover the recheck command with e2e fixtures
adamaltman Sep 18, 2026
0cdd84c
chore(cli): bundle the spell-check packages into the CLI
adamaltman Sep 18, 2026
9dd9c66
Merge remote-tracking branch 'origin/main' into aa/recheck-relocate-e…
adamaltman Sep 24, 2026
3a8a938
docs(recheck): fold the recheck contributor guide into the root guide
adamaltman Sep 24, 2026
22c7c57
Merge remote-tracking branch 'origin/aa/recheck-relocate-engine' into…
adamaltman Sep 24, 2026
969febe
refactor(cli): drop --severity and the recheck baseline key
adamaltman Sep 24, 2026
f77bca2
refactor(recheck): return the lint run as data and print it from the CLI
adamaltman Sep 24, 2026
b8505f6
fix(cli): print the lint preamble before a baseline or run failure
adamaltman Sep 24, 2026
b3a05aa
refactor(cli): move the recheck report formats into the CLI
adamaltman Sep 24, 2026
2fbd2c6
refactor(recheck): return readability rows and print them from the CLI
adamaltman Sep 24, 2026
215468e
refactor(recheck): return the baseline run as data and print it from …
adamaltman Sep 24, 2026
9c29c82
refactor(recheck): return the Markdoc schema result and print it from…
adamaltman Sep 24, 2026
4d6662e
refactor(recheck): drop the engine logger
adamaltman Sep 24, 2026
1c00cf7
docs(recheck): note the data-returning actions in the changeset
adamaltman Sep 24, 2026
809effd
chore(cli): apply the final review of the recheck logger rework
adamaltman Sep 25, 2026
304177a
Merge remote-tracking branch 'origin/main' into aa/recheck-relocate-e…
adamaltman Sep 25, 2026
84518c4
fix(cli): emit ::notice for info findings in the GitHub Actions format
adamaltman Sep 25, 2026
74f2c2b
fix(cli): cover every rule severity in the GitHub Actions command map
adamaltman Sep 25, 2026
21d0f29
refactor(recheck): export preset blocks and the rule merge for core
adamaltman Sep 25, 2026
3a99a42
fix(recheck): keep the public rule merge safe on unvalidated entries
adamaltman Sep 25, 2026
7a7978b
feat(core): resolve recheck presets as a built-in plugin and merge th…
adamaltman Sep 25, 2026
de1b8aa
fix(core): load the recheck plugin for extends in shared files and sc…
adamaltman Sep 25, 2026
3338573
feat(cli): read the merged recheck block from the config
adamaltman Sep 25, 2026
e3ec9e5
chore(recheck): apply the final review fixes for the config integration
adamaltman Sep 25, 2026
e48bdbc
refactor(recheck): keep preset data pure and fill token rule messages…
adamaltman Sep 26, 2026
bc30543
refactor(core): register the recheck presets as a static built-in plugin
adamaltman Sep 26, 2026
4374219
chore(recheck): apply the round-2 review fixes
adamaltman Sep 26, 2026
160125f
refactor(core): own the recheck config merge and set the presets aside
adamaltman Sep 27, 2026
11b12b4
fix(core): keep files under recheck/ and non-object blocks intact in …
adamaltman Sep 27, 2026
3f503b3
refactor(recheck): compose presets in the engine with core's rule merge
adamaltman Sep 27, 2026
f8890d1
chore(recheck): apply the round-3 review fixes
adamaltman Sep 27, 2026
820fd92
fix(core): keep the last listing of a repeated recheck preset
adamaltman Sep 27, 2026
83f8772
Merge remote-tracking branch 'origin/main' into aa/recheck-relocate-e…
adamaltman Sep 28, 2026
243bb5b
refactor(cli): drop --output-path, rename --out, and align recheck op…
adamaltman Sep 28, 2026
f1c3f52
fix(cli): count all problems in the recheck table and warn before the…
adamaltman Sep 28, 2026
ff78cfd
fix(recheck): report config errors with block paths and no repeated path
adamaltman Sep 28, 2026
99ff571
chore(recheck): drop the rule key from messages that already carry it…
adamaltman Sep 29, 2026
69d2189
Merge remote-tracking branch 'origin/main' into aa/recheck-relocate-e…
adamaltman Oct 1, 2026
2f6b195
docs(recheck): link the README to the in-repo command page
adamaltman Oct 1, 2026
29e31ab
docs(recheck): make the README documentation pointer a link
adamaltman Oct 1, 2026
e9bb6e4
test(recheck): audit tests and fill gaps
RomanHotsiy Oct 1, 2026
e7497bf
docs(recheck): rewrite code comments in plain English
RomanHotsiy Oct 1, 2026
075234f
test(recheck): audit token rule tests
RomanHotsiy Oct 1, 2026
820fc48
test(recheck): audit core, actions, config and utils tests
RomanHotsiy Oct 1, 2026
3333f31
test(recheck): audit cli, config, and e2e recheck tests
RomanHotsiy Oct 1, 2026
4b07855
docs(recheck): remove the deleted unit harness from the rules guide
RomanHotsiy Oct 1, 2026
6fa2b20
test(recheck): audit scope, parser and metrics tests
RomanHotsiy Oct 1, 2026
f86c404
fix(recheck): drop stale hints and test references
RomanHotsiy Oct 1, 2026
37c0e31
refactor(recheck): remove the unused `baseline` key from the engine c…
RomanHotsiy Oct 1, 2026
08da759
refactor(core): trim the recheck exports of the package entry point
RomanHotsiy Oct 1, 2026
bfbb907
refactor(recheck): keep test-only token rule exports out of the engine
RomanHotsiy Oct 1, 2026
df6e2bd
test(e2e): remove the check-config case for a recheck block
RomanHotsiy Oct 1, 2026
a32812c
refactor: resolve recheck presets through the normal extends path
RomanHotsiy Oct 2, 2026
309397c
refactor(recheck): stop expanding extends in the engine
RomanHotsiy Oct 2, 2026
18e1bf3
docs(recheck): describe native preset resolution
RomanHotsiy Oct 2, 2026
77a43d9
test: drop leftover recheckExtends references
RomanHotsiy Oct 2, 2026
f4e3011
fix(recheck): keep shared preset data unchanged when validating
RomanHotsiy Oct 2, 2026
ae12d0a
docs(cli): explain the table format fallback in config linting
RomanHotsiy Oct 2, 2026
9aaa913
chore: remove needless config
tatomyr Oct 2, 2026
e5dbdb5
Merge branch 'main' into aa/recheck-relocate-engine
adamaltman Oct 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"@redocly/cli",
"@redocly/openapi-core",
"@redocly/respect-core",
"@redocly/reunite-integration"
"@redocly/reunite-integration",
"@redocly/recheck"
]
],
"linked": [],
Expand Down
11 changes: 11 additions & 0 deletions .changeset/recheck-command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@redocly/cli': minor
'@redocly/openapi-core': minor
'@redocly/recheck': minor
---

Added the `redocly recheck` command.
It lints Markdown prose and structure from the `recheck` block in `redocly.yaml`, with presets named in the root `extends` (for example `recheck/markdown`).
Presets merge with the `recheck` blocks in `extends` order, like other presets.
The engine's actions return data.
The CLI prints it.
9 changes: 9 additions & 0 deletions .changeset/recheck-core-presets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@redocly/openapi-core': minor
---

Added the `plugins` option to `loadConfig` and `createConfig`: ready plugin objects that are added next to the built-in plugin.
Resolved configs carry the merged `recheck` block in `Config.recheck`.
A `recheck/*` entry in `extends` resolves like any other preset when a plugin with the id `recheck` is passed, and is skipped otherwise.
`lint` reads no rules from the block.
A custom plugin cannot use the id `recheck`.
10 changes: 10 additions & 0 deletions .changeset/recheck-engine-relocation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@redocly/recheck': minor
---

Added the `@redocly/recheck` engine package to this repository.
It powers the upcoming `redocly recheck` command.
`@redocly/recheck/presets` exports the presets as a plugin for `@redocly/openapi-core`.

**Note:** the standalone `recheck` binary and `recheck.yaml` are removed.
Comment thread
tatomyr marked this conversation as resolved.
Configuration moves to the `recheck` block of `redocly.yaml`, read by the `redocly recheck` command in a later release.
2 changes: 2 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"output/",
"packages/respect-core/src/modules/runtime-expressions/abnf-parser.js",
"packages/core/src/rules/common/__tests__/fixtures/invalid-yaml.yaml",
"packages/recheck/src/config/__tests__/fixtures/",
"tests/e2e/recheck/*/docs/",
"tests/performance/api-definitions/",
"tests/e2e/generate-client/examples/*/src/api/",
"tests/e2e/generate-client/examples/*/generators/",
Expand Down
3 changes: 2 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
"packages/cli/src/commands/score/**",
"packages/cli/src/commands/generate-spec/**",
"packages/cli/src/commands/drift/**",
"packages/client-generator/**"
"packages/client-generator/**",
"packages/recheck/**"
],
"rules": {
"sonarjs/cognitive-complexity": ["error", 82]
Expand Down
23 changes: 22 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,25 @@ To make changes to documentation:
1. Add the link to the rule page to the [built-in rules list](docs/@v2/rules/built-in-rules.md) and the [sidebar](docs/@v2/v2.sidebars.yaml).
1. Update the rulesets pages and [ruleset templates](docs/@v2/rules/ruleset-templates.md).

### Recheck engine

Recheck is the markdown and prose linting engine in `packages/recheck`.
To add or change a lint rule, see [`packages/recheck/src/rules/CONTRIBUTING.md`](packages/recheck/src/rules/CONTRIBUTING.md).

The example configs in `packages/recheck/examples/*.yaml` are generated from the presets.
When you change a preset, the generator, or an appendix in `examples/appendices/`, regenerate them and commit the result:

```bash
npm run compile
node packages/recheck/scripts/generate-examples.mjs
```

The generator reads the built `lib/`, so compile first.
If you skip this step, `examples-drift.test.ts` fails.

`packages/recheck/src/data/markdoc-realm-schema.ts` is generated from the Realm theme source in the Redocly monorepo.
Regenerate it there with `scripts/generate-markdoc-schema.mjs` pointed at this checkout, and copy the result over.

### Update Redoc

When updating Redoc, recompute the subresource integrity [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) (`redocStandaloneSri` in [package.ts](./packages/cli/src/utils/package.ts)):
Expand Down Expand Up @@ -415,7 +434,7 @@ To add an entry:

- **`docs`**: contains the documentation source files. When changes to the documentation are merged, they automatically get published on the [Redocly docs website](https://redocly.com/docs/cli/).

- **`packages`**: contains the source code. It consists of five packages - CLI, core, respect-core, reunite-integration, and client-generator. The codebase is written in Typescript.
- **`packages`**: contains the source code. It consists of six packages - CLI, core, respect-core, reunite-integration, client-generator, and recheck. The codebase is written in Typescript.
- **`packages/cli`**: contains Redocly CLI commands and utils. More details [in the README](./README.md) file.
- **`packages/cli/src`**: contains CLI package source code.
- **`packages/cli/src/commands`**: contains CLI commands functions.
Expand All @@ -436,6 +455,8 @@ To add an entry:

- **`packages/client-generator`**: contains the client and SDK generators.

- **`packages/recheck`**: contains the Recheck markdown and prose linting engine.

- **`resources`**: contains some example API descriptions and configuration files that might be useful for testing.

- **`cookbook`**: contains the community cookbook — shared rulesets, configuration, custom plugins, and other Redocly CLI additions. It is not part of the build or test suite.
Expand Down
4 changes: 4 additions & 0 deletions docs/@v2/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Docs rendering commands:
- [`translate`](translate.md) Generate translation keys for a Redocly Realm, Reef, or Revel project.
- [`eject`](eject.md) Eject and modify components from the core theme in a Redocly Realm, Reef, or Revel project.

Docs linting commands:

- [`recheck`](recheck.md) Lint Markdown prose and structure from the `recheck` block.

CI and delivery commands:

- [`bundle`](bundle.md) Bundle an API description.
Expand Down
126 changes: 126 additions & 0 deletions docs/@v2/commands/recheck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# `recheck`

## Introduction

The `recheck` command lints Markdown files for prose and structure problems.
It checks headings, sentences, links, images, and Markdoc tags against a set of rules.

Rules come from presets, such as `recheck/markdown`, that you add to the root `extends` in `redocly.yaml`.
The [`recheck` block](../configuration/reference/recheck.md) adjusts those rules.
With no `redocly.yaml`, the command uses `recheck/markdown`.
With a `redocly.yaml` that has neither, the command checks nothing and says so.
The command reads the root `recheck` config; settings under `apis.<name>` are not used.

## Usage

```bash
redocly recheck
redocly recheck <paths>...
redocly recheck [--fix]
redocly recheck [--readability]
redocly recheck [--generate-baseline]
redocly recheck [--generate-markdoc-schema] [--from=<path>...] [--output=<path>] [--check]
redocly recheck --help
```

{% admonition type="info" name="One action per run" %}
`--readability`, `--generate-baseline`, and `--generate-markdoc-schema` each replace the default lint action.
Use at most one of them in a run.
`--fix` works with the default lint action only.
{% /admonition %}

## Options

| Option | Type | Description |
| ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| paths | [string] | Files or directories to lint. Default value is the current directory. |
| --check | boolean | Fail when the generated schema differs from the file in `--output`. Use with `--generate-markdoc-schema`. |
| --config | string | Path to the [configuration file](../configuration/index.md). |
| --fix | boolean | Apply fixes to the Markdown files. Alias: `-f`. |
| --format | string | Format for the report.<br />**Possible values:** `table`, `json`, `sarif`, `github-actions`. Default value is `table`. |
| --from | [string] | Module paths to read Markdoc tags from. Use with `--generate-markdoc-schema`. |
| --generate-baseline | boolean | Write a baseline file from the current errors. |
| --generate-markdoc-schema | boolean | Generate a Markdoc tag schema from theme modules. Needs `--from` and `--output`. |
| --help | boolean | Show help. |
| --lint-config | string | Specify the severity level for the configuration file.<br/> **Possible values:** `warn`, `error`, `off`. Default value is `warn`. |
| --max-problems | number | Maximum number of problems in the report; applies to every format. |
| --output | string | Output file for the generated schema. |
| --readability | boolean | Report readability scores instead of lint findings. |
| --rule | [string] | Run only these rules. Alias: `-r`. |
| --skip-rule | [string] | Skip these rules. |
| --stats | boolean | Print statistics per rule. Alias: `-s`. |
| --summary | string | Print a summary of the run.<br />**Possible values:** `json`, `text`. |
| --summary-path | string | Write the summary to this file. |
| --tags | [string] | Run only rules with these tags. |
| --version | boolean | Show version number. |

## Examples

### Lint a folder

Add a preset to the root `extends`:

```yaml
extends:
- recheck/markdown
```

Then run the command on a folder:

```bash
redocly recheck docs
```

The command lints every Markdown file under `docs` with the rules from `recheck/markdown`.
The report goes to stdout and progress messages go to stderr.

### Turn off a rule

Set the rule to `off` in the `recheck` block:

```yaml
extends:
- recheck/markdown
recheck:
rules:
recheck/line-length: off
```

The run applies every rule from `recheck/markdown` except `recheck/line-length`.

### Annotate a pull request

```bash
redocly recheck docs --format=github-actions
```

In a GitHub Actions workflow, this format adds each finding as an annotation on the changed line.
An error becomes `::error`, a warning `::warning`, and an info finding `::notice`.
Each finding is one line of output:

```text
::error title=recheck/single-h1,file=docs/index.md,line=2,endLine=2,col=1,endColumn=1::Multiple top-level headings in the same document
```

### Use a baseline

A baseline records the current errors.
Later runs report only errors that the baseline does not list.

```bash
redocly recheck docs --generate-baseline
```

The command writes `.redocly.recheck-baseline.yaml` next to `redocly.yaml`.
Commit the file.
Later runs pick it up automatically.

After you fix errors, generate the baseline again and commit the smaller file.

### Check readability

```bash
redocly recheck docs --readability
```

The command prints readability scores for each Markdown file instead of lint findings.
10 changes: 10 additions & 0 deletions docs/@v2/configuration/reference/extends.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ Multiple values are supported, and can include:
- configuration defined in a [custom plugin](../../custom-plugins/index.md)
- a path or URL to another `redocly.yaml` file

Entries that start with `recheck/`, such as `recheck/markdown`, are Recheck presets for [`redocly recheck`](../../commands/recheck.md).
They merge like any other entry, in the order listed: a later entry overrides an earlier one.
Other commands skip them.
A custom plugin cannot use the id `recheck`.

The [`recheck` block](recheck.md) of the file that lists the presets merges on top of them.
The `recheck` command reads the presets in the root `extends` and in the files that the root `extends` lists.
It does not read them from an API's `extends`.
The `lint` command reads no rules from them.

Extends is useful if you use a common ruleset across multiple projects.
Define a ruleset in one location, and each project can `extend` it, with or without modification.

Expand Down
Loading
Loading