54 lines
1.9 KiB
Markdown
54 lines
1.9 KiB
Markdown
# marqdo-lint
|
||
|
||
`marqdo-lint` 是面向 Marqdo `.mq.md` 可执行文档的独立可读性检查工具。它只
|
||
消费当前公开协议:用一次 `check --emit` 取得 Analysis revision 3,用
|
||
`modules[].document` 作为 Markdown 容器,用 `modules[].source` 作为唯一源码,
|
||
检查分支、循环、链接、调用、叙述和说明的阅读质量。
|
||
|
||
## 当前基线
|
||
|
||
- 冻结 Marqdo `3.0.0-rc.4`,源码 `452e9a32…`,详见 [协议基线](docs/PROTOCOL_BASELINE.md)
|
||
- Markdown Profile `marqdo.md.v1`
|
||
- Analysis revision 3(当前字段集合)与 CLI Tool revision 1
|
||
- Rust 1.89 或更新版本
|
||
- Lint 版本 `0.2.0`
|
||
|
||
旧核心、旧 Analysis 字段集合和旧 Tool manifest 都会被明确拒绝,没有兼容
|
||
分支。
|
||
|
||
## 构建
|
||
|
||
```bash
|
||
cargo build --locked
|
||
```
|
||
|
||
运行测试时需要兼容的冻结核心,并通过 `MARQDO_BIN` 指定绝对路径。工具只
|
||
调用 `--version` 与一次 `check ENTRY --json --emit PATH`;`inspect` 不在
|
||
机器路径中。完整验收见 [VALIDATION.md](docs/VALIDATION.md)。
|
||
|
||
## 使用
|
||
|
||
```bash
|
||
marqdo-lint index.mq.md
|
||
marqdo-lint . --profile recommended --format json
|
||
marqdo-lint index.mq.md --refs
|
||
marqdo-lint explain MQD-BRANCH-001
|
||
marqdo-lint rules
|
||
marqdo-lint index.mq.md --fix safe --dry-run
|
||
marqdo-lint index.mq.md --fix safe
|
||
```
|
||
|
||
```bash
|
||
./scripts/package-tool.sh
|
||
marqdo tool install .cache/tool-bundle/tool.json
|
||
marqdo lint index.mq.md
|
||
```
|
||
|
||
直接运行时,`MARQDO_BIN` 可以指定冻结核心的绝对路径。工具默认从当前目录
|
||
读取 `marqdo-lint.toml`,也可使用 `--config FILE`。目录内有 `index.mq.md`
|
||
时从该入口加载项目,否则递归查找 `.mq.md` 文件。
|
||
|
||
默认 `--fail-on warning`。退出码 `0` 表示检查完成且低于门槛,`1` 表示达到
|
||
门槛或安全修复被拒绝,`2` 表示分析不可用、协议错误、配置或工具错误。JSON
|
||
报告格式见 [命令参考](docs/CLI.md),规则目录见 [RULES.md](docs/RULES.md)。
|