Skip to content

Commit ca16b71

Browse files
committed
feat: 添加 rumdl markdown lint 工具并迁移配置
- 添加根目录 .rumdl.toml 配置文件,从 .markdownlint.json 迁移规则 - 为 frontend 和 mpv 配置添加对应的 .rumdl.toml 配置文件 - 移除原有的 .markdownlint.json 配置文件 - 在 lint-staged 中添加 *.md 文件的 rumdl 检查 - 在 package.json 中添加 format:md 脚本和 rumdl 依赖 - 更新 format 脚本包含 markdown 格式化 - 安装 rumdl v0.1.60 版本及其平台特定二进制文件
1 parent 2b3a997 commit ca16b71

8 files changed

Lines changed: 142 additions & 89 deletions

File tree

.rumdl.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# rumdl 配置 - 根目录(默认规则)
2+
# 从 .markdownlint.json 迁移而来
3+
4+
[global]
5+
respect-gitignore = true
6+
exclude = [
7+
"node_modules",
8+
"dist",
9+
"bin",
10+
]
11+
disable = [
12+
"MD013", # line-length - 行宽限制过于严格
13+
"MD033", # no-inline-html - HTML 标签有用,保留
14+
"MD034", # no-bare-urls - 裸链接有时更简洁
15+
"MD036", # emphasis-as-heading - .claude/commands 等 AI 工具配置中大量使用强调作为标题
16+
"MD041", # first-line-heading - 首行不强制为标题
17+
"MD051", # no-emphasis-as-heading - 允许强调符号作为标题
18+
"MD057", # no-relative-links-missing - 相对链接指向不存在文件,影响面太大
19+
]
20+
21+
[MD024]
22+
allow_different_nesting = true
23+
24+
# 前置标题级别检测时忽略 frontmatter
25+
[MD025]
26+
front_matter_title = ""

config/frontend/.markdownlint.json

Lines changed: 0 additions & 45 deletions
This file was deleted.

config/frontend/.rumdl.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# rumdl 配置 - frontend 模板
2+
# 从 .markdownlint.json 迁移而来,启用 no-bare-urls
3+
4+
[global]
5+
respect-gitignore = true
6+
disable = [
7+
"MD013", # line-length
8+
"MD033", # no-inline-html
9+
"MD041", # first-line-heading
10+
"MD051", # no-emphasis-as-heading
11+
]
12+
13+
[MD024]
14+
allow_different_nesting = true
15+
16+
[MD025]
17+
front_matter_title = ""

config/software/mpv/.markdownlint.json

Lines changed: 0 additions & 43 deletions
This file was deleted.

config/software/mpv/.rumdl.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# rumdl 配置 - mpv
2+
# 从 .markdownlint.json 迁移而来,启用 no-bare-urls
3+
4+
[global]
5+
respect-gitignore = true
6+
disable = [
7+
"MD013", # line-length
8+
"MD033", # no-inline-html
9+
"MD041", # first-line-heading
10+
"MD051", # no-emphasis-as-heading
11+
]
12+
13+
[MD024]
14+
allow_different_nesting = true

lint-staged.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export default {
22
'*.{ps1,psm1,psd1}':
33
'pwsh -File ./scripts/pwsh/devops/Format-PowerShellCode.ps1',
44
'*.{js,jsx,ts,tsx,css,html,json,jsonc}': 'biome check --write',
5+
'*.md': 'rumdl check --fix',
56
'*.py': ['uvx ruff check --fix', 'uvx ruff format'],
67
'*.lua': 'stylua',
78
'**/*.ipynb': ['nbstripout'],

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
"format:pwsh:rs:all": "pnpm run pwshfmt:rs -- write --path . --recurse --strict-fallback",
1515
"check:pwsh:rs": "pnpm run pwshfmt:rs -- check --git-changed --strict-fallback",
1616
"format:biome": "biome format --write .",
17+
"format:md": "rumdl fmt .",
1718
"format:python": "uvx ruff format .",
1819
"lint:python": "uvx ruff check --fix .",
19-
"format": "pnpm format:pwsh && pnpm format:python",
20+
"format": "pnpm format:pwsh && pnpm format:md && pnpm format:python",
2021
"pwsh:install": "pwsh -File ./install.ps1",
2122
"pester:install": "pwsh -NoProfile -Command \"Install-Module -Name Pester -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber\"",
2223
"pester:update": "pwsh -NoProfile -Command \"Update-Module -Name Pester -Force -ErrorAction Stop\"",
@@ -65,6 +66,7 @@
6566
"concurrently": "^9.2.1",
6667
"husky": "^9.1.7",
6768
"lint-staged": "^16.3.0",
69+
"rumdl": "^0.1.60",
6870
"turbo": "^2.8.12",
6971
"typescript": "^5.9.3",
7072
"vitest": "^4.0.18"

pnpm-lock.yaml

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)