Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rumdl for openSUSE:Factory checked in at 2026-11-30 14:26:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rumdl (Old) and /work/SRC/openSUSE:Factory/.rumdl.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rumdl" Mon Nov 30 14:26:43 2026 rev:113 rq:1401435 version:0.3.9 Changes: -------- --- /work/SRC/openSUSE:Factory/rumdl/rumdl.changes 2026-11-28 23:27:31.405253245 +0100 +++ /work/SRC/openSUSE:Factory/.rumdl.new.1340718/rumdl.changes 2026-11-30 14:29:10.014927154 +0100 @@ -1,0 +2,12 @@ +Sun Nov 29 06:17:07 UTC 2026 - Johannes Kastl <[email protected]> + +- Update to version 0.3.9: + * Fixed + - MD010: preserve recipe tabs across fence language aliases + (7214829) + - MD001: preserve ExDoc admonitions and tabs when enabled + (4442a15) + - config: preserve unset enable in configuration output + (03f7391) + +------------------------------------------------------------------- Old: ---- rumdl-0.3.8.obscpio New: ---- rumdl-0.3.9.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rumdl.spec ++++++ --- /var/tmp/diff_new_pack.K7Bdpf/_old 2026-11-30 14:29:13.264064330 +0100 +++ /var/tmp/diff_new_pack.K7Bdpf/_new 2026-11-30 14:29:13.265064373 +0100 @@ -17,7 +17,7 @@ Name: rumdl -Version: 0.3.8 +Version: 0.3.9 Release: 0 Summary: Markdown Linter written in Rust # Legal-Review-Notice: MPL-2.0 from the colored crate (statically linked). ++++++ _service ++++++ --- /var/tmp/diff_new_pack.K7Bdpf/_old 2026-11-30 14:29:13.307066146 +0100 +++ /var/tmp/diff_new_pack.K7Bdpf/_new 2026-11-30 14:29:13.311066315 +0100 @@ -3,7 +3,7 @@ <param name="url">https://github.com/rvben/rumdl.git</param> <param name="scm">git</param> <param name="submodules">enable</param> - <param name="revision">refs/tags/v0.3.8</param> + <param name="revision">refs/tags/v0.3.9</param> <param name="match-tag">v*.*.*</param> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.K7Bdpf/_old 2026-11-30 14:29:13.336067370 +0100 +++ /var/tmp/diff_new_pack.K7Bdpf/_new 2026-11-30 14:29:13.340067539 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/rvben/rumdl.git</param> - <param name="changesrevision">cf01e14c3191e771caaaf2e3d79e2f3cc556453d</param></service></servicedata> + <param name="changesrevision">37b8ddd977f5915c83282dceb78e19ac2b2f4308</param></service></servicedata> (No newline at EOF) ++++++ rumdl-0.3.8.obscpio -> rumdl-0.3.9.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/CHANGELOG.md new/rumdl-0.3.9/CHANGELOG.md --- old/rumdl-0.3.8/CHANGELOG.md 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/CHANGELOG.md 2026-11-28 20:59:52.000000000 +0100 @@ -7,6 +7,14 @@ ## [Unreleased] +## [0.3.9](https://github.com/rvben/rumdl/compare/v0.3.8...v0.3.9) - 2026-11-28 + +### Fixed + +- **MD010**: preserve recipe tabs across fence language aliases ([7214829](https://github.com/rvben/rumdl/commit/7214829b591cacd3cfe967e03869fad4f464b2f4)) +- **MD001**: preserve ExDoc admonitions and tabs when enabled ([4442a15](https://github.com/rvben/rumdl/commit/4442a15efad5e969b47d6bb8abe7c3db3dc2cc26)) +- **config**: preserve unset enable in configuration output ([03f7391](https://github.com/rvben/rumdl/commit/03f7391191427ae77d2c3bcd9beef73a65757e91)) + ## [0.3.8](https://github.com/rvben/rumdl/compare/v0.3.7...v0.3.8) - 2026-11-27 ### Added diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/Cargo.lock new/rumdl-0.3.9/Cargo.lock --- old/rumdl-0.3.8/Cargo.lock 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/Cargo.lock 2026-11-28 20:59:52.000000000 +0100 @@ -2721,7 +2721,7 @@ [[package]] name = "rumdl" -version = "0.3.8" +version = "0.3.9" dependencies = [ "aho-corasick", "assert_cmd", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/Cargo.toml new/rumdl-0.3.9/Cargo.toml --- old/rumdl-0.3.8/Cargo.toml 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/Cargo.toml 2026-11-28 20:59:52.000000000 +0100 @@ -1,6 +1,6 @@ [package] name = "rumdl" -version = "0.3.8" +version = "0.3.9" edition = "2024" rust-version = "1.98.0" description = "A fast Markdown linter and formatter written in Rust" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/README.md new/rumdl-0.3.9/README.md --- old/rumdl-0.3.8/README.md 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/README.md 2026-11-28 20:59:52.000000000 +0100 @@ -228,7 +228,7 @@ mise install rumdl # Use a specific version for the project -mise use [email protected] +mise use [email protected] ``` ### Using Nix (macOS/Linux) @@ -460,7 +460,7 @@ ```yaml repos: - repo: https://github.com/rvben/rumdl-pre-commit - rev: v0.3.8 + rev: v0.3.9 hooks: - id: rumdl # Lint only; add args [--fix] to auto-fix - id: rumdl-fmt # Pure format, exits 0 on violations @@ -476,7 +476,7 @@ ```yaml repos: - repo: https://github.com/rvben/rumdl-pre-commit - rev: v0.3.8 + rev: v0.3.9 hooks: - id: rumdl args: [--fix] # Auto-fix violations in place @@ -493,7 +493,7 @@ ```yaml repos: - repo: https://github.com/rvben/rumdl-pre-commit - rev: v0.3.8 + rev: v0.3.9 hooks: - id: rumdl args: [--no-exclude] # Disable all exclude patterns @@ -1249,7 +1249,20 @@ ### Defaults Only (`rumdl config --defaults`) -The `rumdl config --defaults` command shows only the default configuration values, useful for understanding what the built-in defaults are. +The `rumdl config --defaults` command shows built-in defaults. Use `rumdl config --defaults --output toml` for a configuration you can copy. This output omits `enable` so rumdl uses the default +rule set. An explicit `enable = []` starts with an empty rule set. This excerpt shows some global and MD013 defaults. + +```toml +[global] +disable = [] +exclude = [] +include = [] +respect-gitignore = true + +[MD013] +line-length = 80 +code-blocks = true +``` ### Non-Defaults Only (`rumdl config --no-defaults`) @@ -1270,23 +1283,6 @@ This helps you quickly identify what customizations you've made to the default configuration. -The `--defaults` flag prints only the default configuration as TOML, suitable for copy-paste or reference: - -```toml -[global] -enable = [] -disable = [] -exclude = [] -include = [] -respect_gitignore = true -force_exclude = false # Set to true to exclude files even when explicitly specified - -[MD013] -line_length = 80 -code_blocks = true -... -``` - ## Output Style rumdl produces clean, colorized output similar to modern linting tools: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/docs/getting-started/quickstart.md new/rumdl-0.3.9/docs/getting-started/quickstart.md --- old/rumdl-0.3.8/docs/getting-started/quickstart.md 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/docs/getting-started/quickstart.md 2026-11-28 20:59:52.000000000 +0100 @@ -106,7 +106,7 @@ ```yaml repos: - repo: https://github.com/rvben/rumdl-pre-commit - rev: v0.3.8 # Use latest version + rev: v0.3.9 # Use latest version hooks: - id: rumdl ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/docs/global-settings.md new/rumdl-0.3.9/docs/global-settings.md --- old/rumdl-0.3.8/docs/global-settings.md 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/docs/global-settings.md 2026-11-28 20:59:52.000000000 +0100 @@ -30,6 +30,8 @@ | [`disable`](#disable) | `string[]` | `[]` | Disable specific rules | | [`extend-enable`](#extend-enable) | `string[]` | `[]` | Additional rules to enable (additive) | | [`extend-disable`](#extend-disable) | `string[]` | `[]` | Additional rules to disable (additive) | +| [`fixable`](#fixable) | `string[]` | `[]` | Limit which rules may apply fixes | +| [`unfixable`](#unfixable) | `string[]` | `[]` | Prevent fixes from specific rules | | [`per-file-ignores`](#per-file-ignores) | `table` | `{}` | Disable specific rules for specific files | | [`exclude`](#exclude) | `string[]` | `[]` | Files/directories to exclude | | [`include`](#include) | `string[]` | `[]` | Files/directories to include | @@ -604,6 +606,23 @@ With `rumdl check --disable MD041 .`, the result is: MD013 replaced by MD041 (from CLI), plus MD033 (from `extend-disable`, always additive). Final disabled set: MD041, MD033. +### `fixable` + +An empty list (the default) allows all enabled rules that offer fixes to apply +them. A nonempty list restricts `rumdl fmt` and `rumdl check --fix` to fixes +from the listed rules. Other enabled rules still report violations. + +### `unfixable` + +An empty list (the default) blocks no fixes. A listed rule still reports +violations, but its fixes are blocked even if it also appears in `fixable`. +For example, to keep MD010 diagnostics and leave tab fixes to another tool: + +```toml +[global] +unfixable = ["MD010"] +``` + ### `per-file-ignores` **Type**: `table` (file patterns mapped to rule arrays) @@ -1662,7 +1681,7 @@ ```yaml - repo: https://github.com/rvben/rumdl-pre-commit - rev: v0.3.8 + rev: v0.3.9 hooks: - id: rumdl args: [--config=.rumdl.toml] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/docs/md001.md new/rumdl-0.3.9/docs/md001.md --- old/rumdl-0.3.8/docs/md001.md 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/docs/md001.md 2026-11-28 20:59:52.000000000 +0100 @@ -46,6 +46,7 @@ ```toml [MD001] +exdoc-headings = false # Preserve ExDoc admonition and tab headings when enabled front-matter-title = true # Count a title in front matter as an implicit level 1 heading (default: true) front-matter-title-pattern = "^(title|header):" # Regex matching the front matter line that holds the title ``` @@ -87,6 +88,14 @@ That jumps from the implicit level 1 to a level 3 and is flagged. An empty pattern means "no pattern": the default `title:` lookup applies. +### `exdoc-headings` + +For Markdown rendered by Elixir’s ExDoc, set `exdoc-headings = true` under +`[MD001]`. MD001 preserves the H3 or H4 that labels an admonition at the start +of a blockquote, such as `> #### Caution {: .warning}`. Between a matched +`<!-- tabs-open -->` and `<!-- tabs-close -->`, it preserves H3 tab labels +and avoids turning another heading into a tab. This option defaults to false. + ## Headings inside blockquotes Headings inside blockquotes (including nested quotes, a quote inside a list item diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/docs/md010.md new/rumdl-0.3.9/docs/md010.md --- old/rumdl-0.3.8/docs/md010.md 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/docs/md010.md 2026-11-28 20:59:52.000000000 +0100 @@ -81,11 +81,15 @@ replacing it would change the code text. - `ignore-code-languages`: Fence languages whose tabs are never reported, so you can flag tabs in code blocks generally while keeping the languages that need - them. The language is the first word of the info string, matched - case-insensitively, so ```` ```makefile title="Makefile" ```` matches - `makefile`. This only has an effect when `code-blocks = true`, since otherwise - every code block is already skipped. An indented code block has no info - string, so it can never match; use `code-blocks = false` to skip those. + them. MD010 recognizes the same GitHub Linguist names and aliases as MD040. + For example, `["make"]` protects recipe tabs in fences labeled `makefile`, + `bsdmake`, or `mf`, even when MD040 normalizes the label during formatting. + For labels outside Linguist, matching uses the spelling in the fence and + ignores ASCII case. + The usual fence label is the first word of the info string. This setting + applies when `code-blocks = true`. With the default, every code block is + already skipped. An indented code block has no info string, so it can never + match. Use `code-blocks = false` to skip those blocks. Flavors that write the language somewhere other than the first word are read on their own terms: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/docs/mdformat-comparison.md new/rumdl-0.3.9/docs/mdformat-comparison.md --- old/rumdl-0.3.8/docs/mdformat-comparison.md 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/docs/mdformat-comparison.md 2026-11-28 20:59:52.000000000 +0100 @@ -236,7 +236,7 @@ # After - repo: https://github.com/rvben/rumdl-pre-commit - rev: v0.3.8 + rev: v0.3.9 hooks: - id: rumdl ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/docs/usage/ci-cd.md new/rumdl-0.3.9/docs/usage/ci-cd.md --- old/rumdl-0.3.8/docs/usage/ci-cd.md 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/docs/usage/ci-cd.md 2026-11-28 20:59:52.000000000 +0100 @@ -66,7 +66,7 @@ ```yaml - uses: rvben/rumdl@v0 with: - version: "0.3.8" + version: "0.3.9" path: docs/ ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/docs/usage/cli.md new/rumdl-0.3.9/docs/usage/cli.md --- old/rumdl-0.3.8/docs/usage/cli.md 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/docs/usage/cli.md 2026-11-28 20:59:52.000000000 +0100 @@ -326,6 +326,11 @@ rumdl config --no-defaults # Show non-default values only ``` +To copy the defaults into a configuration file, use `rumdl config --defaults +--output toml`. The output omits `enable` so rumdl uses its default rule set. +An explicit `enable = []` starts with an empty rule set. Use `extend-enable` to add rules +to the default set. + ### `server` Start the LSP server. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/docs/usage/pre-commit.md new/rumdl-0.3.9/docs/usage/pre-commit.md --- old/rumdl-0.3.8/docs/usage/pre-commit.md 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/docs/usage/pre-commit.md 2026-11-28 20:59:52.000000000 +0100 @@ -20,7 +20,7 @@ ```yaml title=".pre-commit-config.yaml" repos: - repo: https://github.com/rvben/rumdl-pre-commit - rev: v0.3.8 # Use latest version + rev: v0.3.9 # Use latest version hooks: - id: rumdl # Lint only; add args [--fix] to auto-fix - id: rumdl-fmt # Pure format, exits 0 on violations diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/npm/cli-darwin-arm64/package.json new/rumdl-0.3.9/npm/cli-darwin-arm64/package.json --- old/rumdl-0.3.8/npm/cli-darwin-arm64/package.json 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/npm/cli-darwin-arm64/package.json 2026-11-28 20:59:52.000000000 +0100 @@ -1,6 +1,6 @@ { "name": "@rumdl/cli-darwin-arm64", - "version": "0.3.8", + "version": "0.3.9", "description": "rumdl binary for macOS ARM64 (Apple Silicon)", "license": "MIT", "repository": { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/npm/cli-darwin-x64/package.json new/rumdl-0.3.9/npm/cli-darwin-x64/package.json --- old/rumdl-0.3.8/npm/cli-darwin-x64/package.json 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/npm/cli-darwin-x64/package.json 2026-11-28 20:59:52.000000000 +0100 @@ -1,6 +1,6 @@ { "name": "@rumdl/cli-darwin-x64", - "version": "0.3.8", + "version": "0.3.9", "description": "rumdl binary for macOS x64 (Intel)", "license": "MIT", "repository": { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/npm/cli-linux-arm64/package.json new/rumdl-0.3.9/npm/cli-linux-arm64/package.json --- old/rumdl-0.3.8/npm/cli-linux-arm64/package.json 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/npm/cli-linux-arm64/package.json 2026-11-28 20:59:52.000000000 +0100 @@ -1,6 +1,6 @@ { "name": "@rumdl/cli-linux-arm64", - "version": "0.3.8", + "version": "0.3.9", "description": "rumdl binary for Linux ARM64 (glibc)", "license": "MIT", "repository": { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/npm/cli-linux-arm64-musl/package.json new/rumdl-0.3.9/npm/cli-linux-arm64-musl/package.json --- old/rumdl-0.3.8/npm/cli-linux-arm64-musl/package.json 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/npm/cli-linux-arm64-musl/package.json 2026-11-28 20:59:52.000000000 +0100 @@ -1,6 +1,6 @@ { "name": "@rumdl/cli-linux-arm64-musl", - "version": "0.3.8", + "version": "0.3.9", "description": "rumdl binary for Linux ARM64 (musl/Alpine)", "license": "MIT", "repository": { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/npm/cli-linux-x64/package.json new/rumdl-0.3.9/npm/cli-linux-x64/package.json --- old/rumdl-0.3.8/npm/cli-linux-x64/package.json 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/npm/cli-linux-x64/package.json 2026-11-28 20:59:52.000000000 +0100 @@ -1,6 +1,6 @@ { "name": "@rumdl/cli-linux-x64", - "version": "0.3.8", + "version": "0.3.9", "description": "rumdl binary for Linux x64 (glibc)", "license": "MIT", "repository": { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/npm/cli-linux-x64-musl/package.json new/rumdl-0.3.9/npm/cli-linux-x64-musl/package.json --- old/rumdl-0.3.8/npm/cli-linux-x64-musl/package.json 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/npm/cli-linux-x64-musl/package.json 2026-11-28 20:59:52.000000000 +0100 @@ -1,6 +1,6 @@ { "name": "@rumdl/cli-linux-x64-musl", - "version": "0.3.8", + "version": "0.3.9", "description": "rumdl binary for Linux x64 (musl/Alpine)", "license": "MIT", "repository": { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/npm/cli-win32-x64/package.json new/rumdl-0.3.9/npm/cli-win32-x64/package.json --- old/rumdl-0.3.8/npm/cli-win32-x64/package.json 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/npm/cli-win32-x64/package.json 2026-11-28 20:59:52.000000000 +0100 @@ -1,6 +1,6 @@ { "name": "@rumdl/cli-win32-x64", - "version": "0.3.8", + "version": "0.3.9", "description": "rumdl binary for Windows x64", "license": "MIT", "repository": { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/npm/rumdl/package.json new/rumdl-0.3.9/npm/rumdl/package.json --- old/rumdl-0.3.8/npm/rumdl/package.json 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/npm/rumdl/package.json 2026-11-28 20:59:52.000000000 +0100 @@ -1,6 +1,6 @@ { "name": "rumdl", - "version": "0.3.8", + "version": "0.3.9", "description": "A fast Markdown linter and formatter written in Rust", "license": "MIT", "repository": { @@ -33,12 +33,12 @@ "node": ">=18.0.0" }, "optionalDependencies": { - "@rumdl/cli-darwin-x64": "0.3.8", - "@rumdl/cli-darwin-arm64": "0.3.8", - "@rumdl/cli-linux-x64": "0.3.8", - "@rumdl/cli-linux-arm64": "0.3.8", - "@rumdl/cli-linux-x64-musl": "0.3.8", - "@rumdl/cli-linux-arm64-musl": "0.3.8", - "@rumdl/cli-win32-x64": "0.3.8" + "@rumdl/cli-darwin-x64": "0.3.9", + "@rumdl/cli-darwin-arm64": "0.3.9", + "@rumdl/cli-linux-x64": "0.3.9", + "@rumdl/cli-linux-arm64": "0.3.9", + "@rumdl/cli-linux-x64-musl": "0.3.9", + "@rumdl/cli-linux-arm64-musl": "0.3.9", + "@rumdl/cli-win32-x64": "0.3.9" } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/rumdl.schema.json new/rumdl-0.3.9/rumdl.schema.json --- old/rumdl-0.3.8/rumdl.schema.json 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/rumdl.schema.json 2026-11-28 20:59:52.000000000 +0100 @@ -15,7 +15,6 @@ "description": "Global configuration options", "$ref": "#/$defs/GlobalConfig", "default": { - "enable": [], "disable": [], "exclude": [], "include": [], @@ -32,7 +31,7 @@ } }, "per-file-ignores": { - "description": "Per-file rule ignores: maps file patterns to lists of rules to ignore.\nPatterns are relative to the project root; a leading `~/` expands to the\nhome directory and absolute paths are matched as written.\nExample: { \"README.md\": [\"MD033\"], \"docs/**/*.md\": [\"MD013\"] }", + "description": "Per-file rule ignores: maps file patterns to lists of rules to ignore.\nPatterns are relative to the project root; a leading `~/` expands to the\nhome directory and absolute paths are matched as written.\n\n```toml\n[per-file-ignores]\n\"README.md\" = [\"MD033\"]\n\"docs/**/*.md\" = [\"MD013\"]\n```", "type": "object", "additionalProperties": { "type": "array", @@ -43,7 +42,7 @@ "default": {} }, "per-file-flavor": { - "description": "Per-file flavor overrides: maps file patterns to Markdown flavors.\nPatterns are relative to the project root; a leading `~/` expands to the\nhome directory and absolute paths are matched as written.\nExample: { \"docs/**/*.md\": MkDocs, \"**/*.mdx\": MDX }\nUses IndexMap to preserve config file order for \"first match wins\" semantics", + "description": "Per-file flavor overrides: maps file patterns to Markdown flavors.\nPatterns are relative to the project root; a leading `~/` expands to the\nhome directory and absolute paths are matched as written.\nThe first matching pattern wins.\n\n```toml\n[per-file-flavor]\n\"docs/**/*.md\" = \"mkdocs\"\n\"**/*.mdx\" = \"mdx\"\n```", "type": "object", "additionalProperties": { "$ref": "#/$defs/MarkdownFlavor" @@ -71,12 +70,11 @@ } }, "enable": { - "description": "Enabled rules", + "description": "Rules to enable exclusively. Omit this setting to use the default rules.\nAn explicitly empty list selects an empty base rule set.", "type": "array", "items": { "type": "string" - }, - "default": [] + } }, "disable": { "description": "Disabled rules", @@ -214,7 +212,7 @@ "default": true }, "fixable": { - "description": "Rules that are allowed to be fixed when --fix is used\nIf specified, only these rules will be fixed", + "description": "Rules allowed to apply automatic fixes. An empty list allows all otherwise eligible fixes.\nA nonempty list limits fixes to the listed rules. Other enabled rules still report violations.", "type": "array", "items": { "type": "string" @@ -222,7 +220,7 @@ "default": [] }, "unfixable": { - "description": "Rules that should never be fixed, even when --fix is used\nTakes precedence over fixable", + "description": "Rules whose fixes are blocked even when listed in fixable. An empty list blocks no fixes.\nThese rules still report violations when enabled.", "type": "array", "items": { "type": "string" @@ -1365,12 +1363,11 @@ "type": "object", "properties": { "enable": { - "description": "Enabled rules", + "description": "Rules to enable exclusively. Omit this setting to use the default rules.\nAn explicitly empty list selects an empty base rule set.", "type": "array", "items": { "type": "string" - }, - "default": [] + } }, "disable": { "description": "Disabled rules", @@ -1414,7 +1411,7 @@ ] }, "fixable": { - "description": "Rules that are allowed to be fixed when --fix is used\nIf specified, only these rules will be fixed", + "description": "Rules allowed to apply automatic fixes. An empty list allows all otherwise eligible fixes.\nA nonempty list limits fixes to the listed rules. Other enabled rules still report violations.", "type": "array", "items": { "type": "string" @@ -1422,7 +1419,7 @@ "default": [] }, "unfixable": { - "description": "Rules that should never be fixed, even when --fix is used\nTakes precedence over fixable", + "description": "Rules whose fixes are blocked even when listed in fixable. An empty list blocks no fixes.\nThese rules still report violations when enabled.", "type": "array", "items": { "type": "string" @@ -1877,6 +1874,16 @@ "description": "Heading levels should only increment by one level at a time", "type": "object", "properties": { + "exdoc-headings": { + "description": "Preserve ExDoc admonition titles and tab headings.", + "type": "boolean", + "default": false + }, + "exdoc_headings": { + "description": "Preserve ExDoc admonition titles and tab headings.", + "type": "boolean", + "default": false + }, "front-matter-title": { "description": "Whether a title field in front matter counts as an implicit level-1 heading", "type": "boolean", @@ -2065,7 +2072,7 @@ "default": false }, "ignore-code-languages": { - "description": "Fence languages whose tabs are never reported (default: empty).\nMatched case-insensitively against the first word of the info string.\nOnly has an effect when `code-blocks` is true, and an indented code block\nhas no info string, so it can never match.", + "description": "Fence languages whose tabs are never reported (default: empty).\nKnown GitHub Linguist names and aliases match the same language.\nOther fence labels match by spelling, ignoring ASCII case.\nOnly has an effect when `code-blocks` is true, and an indented code block\nhas no info string, so it can never match.", "type": "array", "items": { "type": "string" @@ -2073,7 +2080,7 @@ "default": [] }, "ignore_code_languages": { - "description": "Fence languages whose tabs are never reported (default: empty).\nMatched case-insensitively against the first word of the info string.\nOnly has an effect when `code-blocks` is true, and an indented code block\nhas no info string, so it can never match.", + "description": "Fence languages whose tabs are never reported (default: empty).\nKnown GitHub Linguist names and aliases match the same language.\nOther fence labels match by spelling, ignoring ASCII case.\nOnly has an effect when `code-blocks` is true, and an indented code block\nhas no info string, so it can never match.", "type": "array", "items": { "type": "string" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/src/commands/config.rs new/rumdl-0.3.9/src/commands/config.rs --- old/rumdl-0.3.8/src/commands/config.rs 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/src/commands/config.rs 2026-11-28 20:59:52.000000000 +0100 @@ -405,57 +405,9 @@ // Handle output format (toml, json, or smart output) match output.as_deref() { - Some("toml") => { - if defaults { - // For defaults with TOML output, generate a complete default config + Some(format @ ("toml" | "json")) => { + let config_to_print = if defaults { let mut default_config = rumdl_config::Config::default(); - - // Add all rule default configurations - for rule in &all_rules_reg { - if let Some((rule_name, toml::Value::Table(table))) = rule.default_config_section() { - let rule_config = rumdl_config::RuleConfig { - severity: None, - values: table.into_iter().collect(), - }; - default_config.rules.insert(rule_name.to_uppercase(), rule_config); - } - } - - match toml::to_string_pretty(&default_config) { - Ok(s) => println!("{s}"), - Err(e) => { - eprintln!("Failed to serialize config to TOML: {e}"); - exit::tool_error(); - } - } - } else if no_defaults { - // For --no-defaults with TOML output, filter to non-defaults - let filtered_sourced = filter_sourced_config_to_non_defaults(&final_sourced_to_print); - let config_to_print: rumdl_config::Config = filtered_sourced.into_validated_unchecked().into(); - match toml::to_string_pretty(&config_to_print) { - Ok(s) => println!("{s}"), - Err(e) => { - eprintln!("Failed to serialize config to TOML: {e}"); - exit::tool_error(); - } - } - } else { - let config_to_print: rumdl_config::Config = final_sourced_to_print.into_validated_unchecked().into(); - match toml::to_string_pretty(&config_to_print) { - Ok(s) => println!("{s}"), - Err(e) => { - eprintln!("Failed to serialize config to TOML: {e}"); - exit::tool_error(); - } - } - } - } - Some("json") => { - if defaults { - // For defaults with JSON output, generate a complete default config - let mut default_config = rumdl_config::Config::default(); - - // Add all rule default configurations for rule in &all_rules_reg { if let Some((rule_name, toml::Value::Table(table))) = rule.default_config_section() { let rule_config = rumdl_config::RuleConfig { @@ -465,33 +417,21 @@ default_config.rules.insert(rule_name.to_uppercase(), rule_config); } } - - match serde_json::to_string_pretty(&default_config) { - Ok(s) => println!("{s}"), - Err(e) => { - eprintln!("Failed to serialize config to JSON: {e}"); - exit::tool_error(); - } - } - } else if no_defaults { - // For --no-defaults with JSON output, filter to non-defaults - let filtered_sourced = filter_sourced_config_to_non_defaults(&final_sourced_to_print); - let config_to_print: rumdl_config::Config = filtered_sourced.into_validated_unchecked().into(); - match serde_json::to_string_pretty(&config_to_print) { - Ok(s) => println!("{s}"), - Err(e) => { - eprintln!("Failed to serialize config to JSON: {e}"); - exit::tool_error(); - } - } + default_config } else { - let config_to_print: rumdl_config::Config = final_sourced_to_print.into_validated_unchecked().into(); - match serde_json::to_string_pretty(&config_to_print) { - Ok(s) => println!("{s}"), - Err(e) => { - eprintln!("Failed to serialize config to JSON: {e}"); - exit::tool_error(); - } + let sourced = if no_defaults { + filter_sourced_config_to_non_defaults(&final_sourced_to_print) + } else { + final_sourced_to_print + }; + sourced.into_validated_unchecked().into() + }; + + match serialize_config(&config_to_print, format) { + Ok(text) => println!("{text}"), + Err(error) => { + eprintln!("Failed to serialize config to {format}: {error}"); + exit::tool_error(); } } } @@ -518,6 +458,35 @@ } } +/// Serialize a config without turning an unset enable list into an explicit one. +fn serialize_config(config: &rumdl_config::Config, format: &str) -> Result<String, String> { + if format == "json" { + let mut document = serde_json::to_value(config).map_err(|error| error.to_string())?; + if !config.global.has_enable_list() { + document["global"] + .as_object_mut() + .expect("global config is an object") + .shift_remove("enable"); + } + serde_json::to_string_pretty(&document).map_err(|error| error.to_string()) + } else { + let text = toml::to_string_pretty(config).map_err(|error| error.to_string())?; + if config.global.has_enable_list() { + return Ok(text); + } + + // Keep table order: per-file flavor selects the first matching pattern. + let mut document = text + .parse::<toml_edit::DocumentMut>() + .map_err(|error| error.to_string())?; + document["global"] + .as_table_mut() + .expect("global config is a table") + .remove("enable"); + Ok(document.to_string()) + } +} + /// Filter a SourcedConfig to only include non-default values fn filter_sourced_config_to_non_defaults( sourced: &rumdl_config::SourcedConfig<rumdl_config::ConfigLoaded>, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/src/config/global_keys.rs new/rumdl-0.3.9/src/config/global_keys.rs --- old/rumdl-0.3.8/src/config/global_keys.rs 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/src/config/global_keys.rs 2026-11-28 20:59:52.000000000 +0100 @@ -90,6 +90,7 @@ }; Some(match norm_key { + "enable" if !effective.has_enable_list() => GlobalKeyValue::Unset, "enable" => strings(&effective.enable, &sourced.enable), "disable" => strings(&effective.disable, &sourced.disable), "include" => strings(&effective.include, &sourced.include), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/src/config/schema_gen.rs new/rumdl-0.3.9/src/config/schema_gen.rs --- old/rumdl-0.3.8/src/config/schema_gen.rs 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/src/config/schema_gen.rs 2026-11-28 20:59:52.000000000 +0100 @@ -83,6 +83,12 @@ pub fn config_schema_json() -> Value { let mut schema = serde_json::to_value(schemars::schema_for!(Config)).expect("the Config schema serializes"); + // The serialized GlobalConfig default uses an empty backing vector for + // enable. A config with that key present selects an empty base rule set. + if let Some(Value::Object(global_default)) = schema.pointer_mut("/properties/global/default") { + global_default.shift_remove("enable"); + } + let root = schema.as_object_mut().expect("schemars emits an object for Config"); // Rule sections arrive through the flatten map, so any root key that is not diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/src/config/types.rs new/rumdl-0.3.9/src/config/types.rs --- old/rumdl-0.3.8/src/config/types.rs 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/src/config/types.rs 2026-11-28 20:59:52.000000000 +0100 @@ -71,15 +71,25 @@ /// Per-file rule ignores: maps file patterns to lists of rules to ignore. /// Patterns are relative to the project root; a leading `~/` expands to the /// home directory and absolute paths are matched as written. - /// Example: { "README.md": ["MD033"], "docs/**/*.md": ["MD013"] } + /// + /// ```toml + /// [per-file-ignores] + /// "README.md" = ["MD033"] + /// "docs/**/*.md" = ["MD013"] + /// ``` #[serde(default, rename = "per-file-ignores")] pub per_file_ignores: BTreeMap<String, Vec<String>>, /// Per-file flavor overrides: maps file patterns to Markdown flavors. /// Patterns are relative to the project root; a leading `~/` expands to the /// home directory and absolute paths are matched as written. - /// Example: { "docs/**/*.md": MkDocs, "**/*.mdx": MDX } - /// Uses IndexMap to preserve config file order for "first match wins" semantics + /// The first matching pattern wins. + /// + /// ```toml + /// [per-file-flavor] + /// "docs/**/*.md" = "mkdocs" + /// "**/*.mdx" = "mdx" + /// ``` #[serde(default, rename = "per-file-flavor")] #[schemars(with = "BTreeMap<String, MarkdownFlavor>")] pub per_file_flavor: IndexMap<String, MarkdownFlavor>, @@ -649,8 +659,10 @@ #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, schemars::JsonSchema)] #[serde(default, rename_all = "kebab-case")] pub struct GlobalConfig { - /// Enabled rules + /// Rules to enable exclusively. Omit this setting to use the default rules. + /// An explicitly empty list selects an empty base rule set. #[serde(default)] + #[schemars(skip_serializing_if = "Vec::is_empty")] pub enable: Vec<String>, /// Disabled rules @@ -683,13 +695,13 @@ #[serde(skip_serializing_if = "Option::is_none", alias = "output_format")] pub output_format: Option<String>, - /// Rules that are allowed to be fixed when --fix is used - /// If specified, only these rules will be fixed + /// Rules allowed to apply automatic fixes. An empty list allows all otherwise eligible fixes. + /// A nonempty list limits fixes to the listed rules. Other enabled rules still report violations. #[serde(default)] pub fixable: Vec<String>, - /// Rules that should never be fixed, even when --fix is used - /// Takes precedence over fixable + /// Rules whose fixes are blocked even when listed in fixable. An empty list blocks no fixes. + /// These rules still report violations when enabled. #[serde(default)] pub unfixable: Vec<String>, @@ -784,6 +796,11 @@ } impl GlobalConfig { + /// Whether the configuration selects an explicit base rule set. + pub fn has_enable_list(&self) -> bool { + self.enable_is_explicit || !self.enable.is_empty() + } + /// Canonicalize every rule-name list in this `GlobalConfig`. /// /// Rewrites `enable`, `disable`, `extend_enable`, `extend_disable`, `fixable`, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/src/formatter.rs new/rumdl-0.3.9/src/formatter.rs --- old/rumdl-0.3.8/src/formatter.rs 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/src/formatter.rs 2026-11-28 20:59:52.000000000 +0100 @@ -587,12 +587,14 @@ let root = sourced.project_root.as_deref(); let mut all_lines = Vec::new(); // [global] section - let global_lines = vec![ - ("[global]".to_string(), String::new()), - ( + let mut global_lines = vec![("[global]".to_string(), String::new())]; + if g.enable.source != rumdl_config::ConfigSource::Default { + global_lines.push(( format!("enable = {:?}", g.enable.value), provenance_label(&g.enable, root), - ), + )); + } + global_lines.extend([ ( format!("disable = {:?}", g.disable.value), provenance_label(&g.disable, root), @@ -613,10 +615,9 @@ format!("editorconfig = {}", g.editorconfig.value), provenance_label(&g.editorconfig, root), ), - ]; + ]); // Add flavor if it's set - let mut global_lines = global_lines; global_lines.push(( format!("flavor = \"{}\"", g.flavor.value), format!("[from {}]", format_provenance(g.flavor.source)), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/src/rules/md001_heading_increment/exdoc.rs new/rumdl-0.3.9/src/rules/md001_heading_increment/exdoc.rs --- old/rumdl-0.3.8/src/rules/md001_heading_increment/exdoc.rs 1970-01-01 01:00:00.000000000 +0100 +++ new/rumdl-0.3.9/src/rules/md001_heading_increment/exdoc.rs 2026-11-28 20:59:52.000000000 +0100 @@ -0,0 +1,121 @@ +use crate::lint_context::LintContext; +use pulldown_cmark::{Event, Parser, Tag, TagEnd}; +use std::collections::HashSet; + +#[derive(Default)] +pub(super) struct Headings { + pub(super) admonitions: HashSet<usize>, + pub(super) tab_headings: HashSet<usize>, + boundaries: Vec<(usize, bool)>, +} + +#[derive(Default)] +struct Container { + first_in_quote: bool, + first_heading: Option<usize>, + tab: Option<(usize, Vec<usize>)>, +} + +fn admonition_class(line: &str) -> bool { + let Some((_, attrs)) = line.trim_end().strip_suffix('}').and_then(|s| s.rsplit_once("{:")) else { + return false; + }; + static ATTRIBUTES: std::sync::LazyLock<regex::Regex> = + std::sync::LazyLock::new(|| regex::Regex::new(r#"([^\s=]+)=(?:"([^"]*)"|'([^']*)'|(\S+))|(\S+)"#).unwrap()); + let recognized = |class: &str| matches!(class, "warning" | "error" | "info" | "tip" | "neutral"); + ATTRIBUTES.captures_iter(attrs).any(|token| { + if let Some(word) = token.get(5) { + return word.as_str().strip_prefix('.').is_some_and(recognized); + } + token.get(1).is_some_and(|key| key.as_str() == "class") + && (2..=4) + .find_map(|i| token.get(i)) + .is_some_and(|value| value.as_str().split_ascii_whitespace().any(recognized)) + }) +} + +impl Headings { + pub(super) fn parse(ctx: &LintContext) -> Self { + let mut roles = Self::default(); + let mut stack = vec![Container::default()]; + let parser = Parser::new_ext( + ctx.content, + crate::utils::parser_options::rumdl_parser_options_for(ctx.content), + ); + for (event, span) in parser.into_offset_iter() { + let parent = stack.last_mut().expect("document container"); + match event { + Event::Start(Tag::HtmlBlock) | Event::End(TagEnd::HtmlBlock) => {} + Event::Html(comment) => { + parent.first_in_quote = false; + parent.first_heading = None; + match comment + .trim() + .strip_prefix("<!--") + .and_then(|s| s.strip_suffix("-->")) + .map(str::trim) + { + Some("tabs-open") => parent.tab = Some((span.start, Vec::new())), + Some("tabs-close") => { + if let Some((start, headings)) = parent.tab.take() { + roles.tab_headings.extend(headings); + roles.boundaries.extend([(start, true), (span.end, false)]); + } + } + _ => {} + } + } + Event::Start(tag) => { + if let Some(heading) = parent.first_heading.take() + && matches!(tag, Tag::Paragraph) + && let Some(first) = ctx.content[span.clone()].lines().next() + && first.starts_with("{:") + && admonition_class(first) + { + roles.admonitions.insert(heading); + } + if let Tag::Heading { .. } = tag { + let (line, _) = ctx.offset_to_line_col(span.start); + if let Some((_, tabs)) = &mut parent.tab { + tabs.push(line); + } + if parent.first_in_quote { + parent.first_heading = Some(line); + if admonition_class(ctx.lines[line - 1].content(ctx.content)) { + roles.admonitions.insert(line); + } + } + } + parent.first_in_quote = false; + stack.push(Container { + first_in_quote: matches!(tag, Tag::BlockQuote(_)), + ..Container::default() + }); + } + Event::End(_) => { + stack.pop(); + } + _ => {} + } + } + roles.boundaries.sort_unstable_by(|a, b| b.cmp(a)); + roles + } + + /// Each tabset inherits the enclosing outline and restores it at its closing marker. + pub(super) fn enter_heading( + &mut self, + offset: usize, + previous: &mut Option<usize>, + enclosing: &mut Vec<Option<usize>>, + ) { + while self.boundaries.last().is_some_and(|(at, _)| *at <= offset) { + let (_, open) = self.boundaries.pop().unwrap(); + if open { + enclosing.push(*previous); + } else { + *previous = enclosing.pop().expect("matched tab markers"); + } + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/src/rules/md001_heading_increment.rs new/rumdl-0.3.9/src/rules/md001_heading_increment.rs --- old/rumdl-0.3.8/src/rules/md001_heading_increment.rs 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/src/rules/md001_heading_increment.rs 2026-11-28 20:59:52.000000000 +0100 @@ -7,10 +7,15 @@ use regex::Regex; use serde::{Deserialize, Serialize}; +mod exdoc; + /// Configuration for MD001 (Heading increment) #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, schemars::JsonSchema)] #[serde(rename_all = "kebab-case")] pub(super) struct MD001Config { + /// Preserve ExDoc admonition titles and tab headings. + #[serde(default, alias = "exdoc_headings")] + pub exdoc_headings: bool, /// Whether a title field in front matter counts as an implicit level-1 heading #[serde(default = "default_front_matter_title", alias = "front_matter_title")] pub front_matter_title: bool, @@ -29,6 +34,7 @@ impl Default for MD001Config { fn default() -> Self { Self { + exdoc_headings: false, front_matter_title: default_front_matter_title(), front_matter_title_pattern: None, } @@ -110,6 +116,7 @@ /// #[derive(Debug, Clone)] pub struct MD001HeadingIncrement { + pub exdoc_headings: bool, /// Whether to treat frontmatter title field as an implicit H1 pub front_matter_title: bool, /// Optional regex pattern to match custom title fields in frontmatter @@ -119,6 +126,7 @@ impl Default for MD001HeadingIncrement { fn default() -> Self { Self { + exdoc_headings: false, front_matter_title: true, front_matter_title_pattern: None, } @@ -139,6 +147,7 @@ /// Create a new instance with specified settings pub fn new(front_matter_title: bool) -> Self { Self { + exdoc_headings: false, front_matter_title, front_matter_title_pattern: None, } @@ -157,6 +166,7 @@ }); Self { + exdoc_headings: false, front_matter_title, front_matter_title_pattern, } @@ -165,11 +175,14 @@ /// An empty pattern is read as "no pattern": compiled, it would match every line /// and turn any front matter at all into an implicit level-1 heading. fn from_config_struct(config: MD001Config, values_withheld: bool) -> Self { - Self::with_pattern_from( - config.front_matter_title, - config.front_matter_title_pattern.filter(|p| !p.is_empty()), - values_withheld, - ) + Self { + exdoc_headings: config.exdoc_headings, + ..Self::with_pattern_from( + config.front_matter_title, + config.front_matter_title_pattern.filter(|p| !p.is_empty()), + values_withheld, + ) + } } /// Check if the document has a front matter title field @@ -227,7 +240,7 @@ impl Rule for MD001HeadingIncrement { fn native_format_policy(&self) -> Option<crate::format_proof::NativeFormatPolicy> { - (self.front_matter_title && self.front_matter_title_pattern.is_none()) + (!self.exdoc_headings && self.front_matter_title && self.front_matter_title_pattern.is_none()) .then_some(crate::format_proof::NativeFormatPolicy::for_rule::<Self>(1)) } @@ -248,6 +261,8 @@ None }; + let mut enclosing = Vec::new(); + let mut exdoc = self.exdoc_headings.then(|| exdoc::Headings::parse(ctx)); for valid_heading in ctx.headings() { let heading = valid_heading.heading; let line_info = valid_heading.line_info; @@ -265,16 +280,36 @@ let level = heading.level as usize; + if let Some(roles) = &mut exdoc { + roles.enter_heading(line_info.byte_offset, &mut prev_level, &mut enclosing); + if matches!(level, 3 | 4) && roles.admonitions.contains(&valid_heading.line_num) { + continue; + } + if level == 3 && roles.tab_headings.contains(&valid_heading.line_num) { + prev_level = Some(level); + continue; + } + } let (fix_info, new_prev) = Self::compute_heading_fix(prev_level, heading); + let changes_role = exdoc.as_ref().is_some_and(|roles| { + (fix_info.fixed_level == 3 && roles.tab_headings.contains(&valid_heading.line_num)) + || (matches!(fix_info.fixed_level, 3 | 4) && roles.admonitions.contains(&valid_heading.line_num)) + }); // Keep the raw violation for suppression accounting, but track the // original level when this heading will not be rewritten. let disabled = (valid_heading.first_line_num()..=valid_heading.line_num) .any(|line| ctx.is_rule_disabled(self.name(), line)); - prev_level = if disabled { Some(level) } else { new_prev }; + prev_level = if disabled || changes_role { + Some(level) + } else { + new_prev + }; if fix_info.needs_fix { let line_content = line_info.content(ctx.content); - let fix = if heading.style == crate::lint_context::HeadingStyle::ATX { + let fix = if changes_role { + None + } else if heading.style == crate::lint_context::HeadingStyle::ATX { // Rewriting only the `#` run leaves every container prefix untouched. let marker_start = line_info.byte_offset + heading.marker_column; Some(Fix::new( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/src/rules/md010_no_hard_tabs/md010_config.rs new/rumdl-0.3.9/src/rules/md010_no_hard_tabs/md010_config.rs --- old/rumdl-0.3.8/src/rules/md010_no_hard_tabs/md010_config.rs 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/src/rules/md010_no_hard_tabs/md010_config.rs 2026-11-28 20:59:52.000000000 +0100 @@ -16,7 +16,8 @@ pub code_blocks: bool, /// Fence languages whose tabs are never reported (default: empty). - /// Matched case-insensitively against the first word of the info string. + /// Known GitHub Linguist names and aliases match the same language. + /// Other fence labels match by spelling, ignoring ASCII case. /// Only has an effect when `code-blocks` is true, and an indented code block /// has no info string, so it can never match. #[serde(default)] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/src/rules/md010_no_hard_tabs.rs new/rumdl-0.3.9/src/rules/md010_no_hard_tabs.rs --- old/rumdl-0.3.8/src/rules/md010_no_hard_tabs.rs 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/src/rules/md010_no_hard_tabs.rs 2026-11-28 20:59:52.000000000 +0100 @@ -220,15 +220,21 @@ fn ignored_language_lines(&self, ctx: &crate::lint_context::LintContext) -> std::collections::HashSet<usize> { let mut ignored = std::collections::HashSet::new(); + let language_key = |label: &str| { + crate::linguist_data::resolve_canonical(label) + .unwrap_or(label) + .to_ascii_lowercase() + }; + let ignored_languages: std::collections::HashSet<_> = self + .config + .ignore_code_languages + .iter() + .map(|listed| language_key(listed)) + .collect(); + for detail in ctx.code_block_details.iter().chain(ctx.colon_fence_details()) { let label = Self::fence_language(&detail.info_string, ctx.flavor); - if label.is_empty() - || !self - .config - .ignore_code_languages - .iter() - .any(|listed| listed.eq_ignore_ascii_case(label.as_ref())) - { + if label.is_empty() || !ignored_languages.contains(&language_key(&label)) { continue; } @@ -1212,6 +1218,18 @@ } #[test] + fn custom_fence_labels_match_by_spelling_and_ignore_ascii_case() { + let content = "```TEAM-DSL\n\tkeep\n```\n```other-dsl\n\tfix\n```"; + let ctx = LintContext::new(content, crate::config::MarkdownFlavor::Standard, None); + let rule = MD010NoHardTabs::from_config_struct(MD010Config { + code_blocks: true, + ignore_code_languages: vec!["team-dsl".into()], + ..Default::default() + }); + assert_eq!(rule.fix(&ctx).unwrap(), content.replace("\tfix", " fix")); + } + + #[test] fn test_ignore_code_languages_matches_only_the_first_info_string_word() { // The label is the first word, so attributes after it do not defeat the match. let labelled = "```makefile title=\"Makefile\"\ntarget:\n\tcommand\n```"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/src/rules/mod.rs new/rumdl-0.3.9/src/rules/mod.rs --- old/rumdl-0.3.8/src/rules/mod.rs 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/src/rules/mod.rs 2026-11-28 20:59:52.000000000 +0100 @@ -902,7 +902,7 @@ } // If 'enable' is specified, only use those rules - if !global_config.enable.is_empty() || global_config.enable_is_explicit { + if global_config.has_enable_list() { if contains_all_keyword(&global_config.enable) || extend_enable_all { // enable: ["ALL"] or extend-enable: ["ALL"] → all rules including opt-in for rule in rules { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/tests/cli/cli_integration_tests.rs new/rumdl-0.3.9/tests/cli/cli_integration_tests.rs --- old/rumdl-0.3.8/tests/cli/cli_integration_tests.rs 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/tests/cli/cli_integration_tests.rs 2026-11-28 20:59:52.000000000 +0100 @@ -1775,16 +1775,8 @@ ); // Should not mention .rumdl.toml assert!(!stdout.contains(".rumdl.toml"), "Output should not mention .rumdl.toml"); - // Should contain a known default (e.g., enable = []) - assert!( - stdout.contains("enable = ["), - "Output should contain default enable = []" - ); - // Should NOT contain the custom value from .rumdl.toml - assert!( - !stdout.contains("enable = [\"MD013\"]"), - "Output should not contain custom config values from .rumdl.toml" - ); + assert!(stdout.lines().any(|line| line.starts_with("disable = []"))); + assert!(!stdout.lines().any(|line| line.starts_with("enable ="))); // Output is NOT valid TOML (annotated), so do not parse as TOML } @@ -1828,29 +1820,9 @@ ); // Should not mention .rumdl.toml assert!(!stdout.contains(".rumdl.toml"), "Output should not mention .rumdl.toml"); - // Should contain a known default (e.g., enable = []) - assert!( - stdout.contains("enable = ["), - "Output should contain default enable = []" - ); - // Should NOT contain the custom value from .rumdl.toml - assert!( - !stdout.contains("enable = [\"MD013\"]"), - "Output should not contain custom config values from .rumdl.toml" - ); - // Output should be valid TOML (parse all [section] blocks) - let mut current = String::new(); - for line in stdout.lines() { - if line.starts_with('[') && !current.is_empty() { - toml::from_str::<Value>(¤t).expect("Section is not valid TOML"); - current.clear(); - } - current.push_str(line); - current.push('\n'); - } - if !current.trim().is_empty() { - toml::from_str::<Value>(¤t).expect("Section is not valid TOML"); - } + let config: Value = toml::from_str(&stdout).expect("defaults must be valid TOML"); + assert!(config["global"]["disable"].as_array().is_some_and(Vec::is_empty)); + assert!(config["global"].get("enable").is_none()); } #[test] @@ -4191,3 +4163,106 @@ "Should process only 1 file, stdout: {stdout}" ); } + +#[test] +fn md001_preserves_exdoc_rendering_roles_when_enabled() { + let cases = [ + ( + "# Guide\n\n> #### Note {: .error}\n", + "# Guide\n\n> #### Note {: .error}\n", + ), + ( + "# Guide\n\n> > ### Note\n> > {: .tip}\n", + "# Guide\n\n> > ### Note\n> > {: .tip}\n", + ), + ( + "# Guide\n\n> #### Other {: .unknown}\n", + "# Guide\n\n> ## Other {: .unknown}\n", + ), + ( + "# Guide\n\n> Before.\n>\n> #### Late {: .error}\n", + "# Guide\n\n> Before.\n>\n> ## Late {: .error}\n", + ), + ( + "# Guide\n\n<!-- tabs-open -->\n\n### One\n\n#### Detail\n\n### Two\n\n<!-- tabs-close -->\n", + "# Guide\n\n<!-- tabs-open -->\n\n### One\n\n#### Detail\n\n### Two\n\n<!-- tabs-close -->\n", + ), + ( + "# Guide\n\n<!-- tabs-open -->\n\n### Ordinary\n", + "# Guide\n\n<!-- tabs-open -->\n\n## Ordinary\n", + ), + ( + "# Guide\n\n```html\n<!-- tabs-open -->\n```\n\n### Ordinary\n\n<!-- tabs-close -->\n", + "# Guide\n\n```html\n<!-- tabs-open -->\n```\n\n## Ordinary\n\n<!-- tabs-close -->\n", + ), + ( + "# Guide\n\n> #### Title\n>\n> {: .error}\n", + "# Guide\n\n> #### Title\n>\n> {: .error}\n", + ), + ( + "# Guide\n\n> #### Title {: class='custom error'}\n", + "# Guide\n\n> #### Title {: class='custom error'}\n", + ), + ( + "# Guide\n\n> #### Title {: title='some .error text'}\n", + "# Guide\n\n> ## Title {: title='some .error text'}\n", + ), + ( + "# Guide\n\n> #### Note {: .error}\n\n#### After\n", + "# Guide\n\n> #### Note {: .error}\n\n## After\n", + ), + ( + "# Guide\n\n<!-- tabs-open -->\n\n### One\n\n<!-- tabs-close -->\n\n#### After\n", + "# Guide\n\n<!-- tabs-open -->\n\n### One\n\n<!-- tabs-close -->\n\n## After\n", + ), + ]; + for (source, expected) in cases { + for input in [source, expected] { + cargo_bin_cmd!("rumdl") + .args([ + "fmt", + "--isolated", + "--enable", + "MD001", + "--config", + "MD001.exdoc-headings=true", + "-", + ]) + .write_stdin(input) + .assert() + .success() + .stdout(expected); + } + } + cargo_bin_cmd!("rumdl") + .args(["fmt", "--isolated", "--enable", "MD001", "-"]) + .write_stdin(cases[0].0) + .assert() + .success() + .stdout("# Guide\n\n> ## Note {: .error}\n"); +} + +#[test] +fn md001_reports_skips_without_converting_ordinary_headings_to_exdoc_widgets() { + for source in [ + "## Context\n\n> ##### Ordinary {: .error}\n", + "## Context\n\n<!-- tabs-open -->\n\n##### Deep\n\n<!-- tabs-close -->\n", + ] { + cargo_bin_cmd!("rumdl") + .args([ + "check", + "--isolated", + "--enable", + "MD001", + "--config", + "MD001.exdoc-headings=true", + "--fix", + "-", + ]) + .write_stdin(source) + .assert() + .code(1) + .stdout(source) + .stderr(predicate::str::contains("Expected heading level 3")); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/tests/cli/cli_md010_tab_structure_test.rs new/rumdl-0.3.9/tests/cli/cli_md010_tab_structure_test.rs --- old/rumdl-0.3.8/tests/cli/cli_md010_tab_structure_test.rs 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/tests/cli/cli_md010_tab_structure_test.rs 2026-11-28 20:59:52.000000000 +0100 @@ -311,3 +311,37 @@ assert_ne!(structure(source, true), structure(broken, true), "{source:?}"); } } + +#[test] +fn md010_preserves_make_recipes_across_fence_aliases() { + use assert_cmd::cargo::cargo_bin_cmd; + + for (rules, expected_label) in [("MD010", "bsdmake"), ("MD010,MD040", "make")] { + let original = "```bsdmake\nall:\n\t@echo ok\n```\n"; + let expected = format!("```{expected_label}\nall:\n\t@echo ok\n```\n"); + for input in [original, expected.as_str()] { + cargo_bin_cmd!("rumdl") + .args([ + "fmt", + "--isolated", + "--enable", + rules, + "--config", + "MD010.code-blocks=true", + "--config", + "MD010.ignore-code-languages=['make']", + "--config", + "MD010.spaces-per-tab=4", + "--config", + "MD040.style='consistent'", + "--config", + "MD040.preferred-aliases={Makefile='make'}", + "-", + ]) + .write_stdin(input) + .assert() + .success() + .stdout(expected.clone()); + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rumdl-0.3.8/tests/config/config_schema_display_split_test.rs new/rumdl-0.3.9/tests/config/config_schema_display_split_test.rs --- old/rumdl-0.3.8/tests/config/config_schema_display_split_test.rs 2026-11-27 17:34:43.000000000 +0100 +++ new/rumdl-0.3.9/tests/config/config_schema_display_split_test.rs 2026-11-28 20:59:52.000000000 +0100 @@ -186,7 +186,7 @@ let dir = tempdir().unwrap(); fs::write(dir.path().join(".rumdl.toml"), &defaults).unwrap(); - fs::write(dir.path().join("test.md"), "# Title\n\nBody text.\n").unwrap(); + fs::write(dir.path().join("test.md"), "# Title\n\nTrailing spaces. \n").unwrap(); let output = Command::new(rumdl_bin()) .current_dir(dir.path()) @@ -200,6 +200,129 @@ "rumdl rejects its own published defaults with a `{complaint}` warning:\n{stderr}" ); } + let stdout = String::from_utf8_lossy(&output.stdout); + assert_eq!(output.status.code(), Some(1), "{stdout}\n{stderr}"); + assert!( + stdout.contains("MD009"), + "the published defaults disabled MD009: {stdout}" + ); + + fs::write(dir.path().join(".rumdl.toml"), "[global]\nenable = []\n").unwrap(); + let output = Command::new(rumdl_bin()) + .current_dir(dir.path()) + .args(["check", "--no-cache", "test.md"]) + .output() + .unwrap(); + assert!( + output.status.success(), + "an explicit empty enable list must disable MD009" + ); +} + +#[test] +fn config_display_distinguishes_unset_enable_from_an_empty_list() { + let dir = tempdir().unwrap(); + let path = dir.path().join(".rumdl.toml"); + for (input, explicit) in [("[global]\n", false), ("[global]\nenable = []\n", true)] { + fs::write(&path, input).unwrap(); + let run = |args: &[&str]| -> String { + let output = Command::new(rumdl_bin()) + .current_dir(dir.path()) + .arg("config") + .args(args) + .output() + .unwrap(); + assert!( + output.status.success(), + "{args:?}: {}", + String::from_utf8_lossy(&output.stderr) + ); + String::from_utf8(output.stdout).unwrap() + }; + + let text = run(&[]); + assert_eq!(text.lines().any(|line| line.starts_with("enable = []")), explicit); + let json: serde_json::Value = serde_json::from_str(&run(&["--output", "json"])).unwrap(); + let expected_json = explicit.then(|| serde_json::json!([])); + assert_eq!(json["global"].get("enable"), expected_json.as_ref()); + let toml: toml::Value = toml::from_str(&run(&["--no-defaults", "--output", "toml"])).unwrap(); + assert_eq!(toml["global"].get("enable").is_some(), explicit); + let queried = run(&["get", "global.enable"]); + assert!(queried.starts_with(if explicit { + "global.enable = []" + } else { + "global.enable = <unset> [no default]" + })); + } + let json = Command::new(rumdl_bin()) + .args(["config", "--defaults", "--output", "json"]) + .output() + .unwrap(); + assert!(json.status.success()); + let json: serde_json::Value = serde_json::from_slice(&json.stdout).unwrap(); + assert!(json["global"].get("enable").is_none()); +} + +#[test] +fn enable_has_no_schema_default() { + let schema = rumdl_lib::config::config_schema_json(); + for properties in [&schema["properties"], &schema["$defs"]["GlobalConfig"]["properties"]] { + assert_eq!(properties["enable"]["type"], "array"); + assert!(properties["enable"].get("default").is_none()); + } + let global_default = &schema["properties"]["global"]["default"]; + assert_eq!(global_default["disable"], serde_json::json!([])); + assert!(global_default.get("enable").is_none()); +} + +#[test] +fn per_file_examples_from_the_schema_load_as_toml() { + let schema = rumdl_lib::config::config_schema_json(); + let dir = tempdir().unwrap(); + let path = dir.path().join(".rumdl.toml"); + let mut examples = String::new(); + for key in ["per-file-ignores", "per-file-flavor"] { + let description = schema["properties"][key]["description"].as_str().unwrap(); + let example = description + .split_once("```toml\n") + .and_then(|(_, fenced)| fenced.split_once("\n```")) + .unwrap_or_else(|| panic!("{key} should have a fenced TOML example")); + examples.push_str(example.0); + examples.push_str("\n\n"); + } + fs::write(&path, examples).unwrap(); + + let sourced = SourcedConfig::load_with_discovery(path.to_str(), None, false).unwrap(); + assert_eq!(sourced.per_file_ignores.value["README.md"], ["MD033"]); + assert_eq!(sourced.per_file_ignores.value["docs/**/*.md"], ["MD013"]); + assert_eq!(sourced.per_file_flavor.value["docs/**/*.md"].to_string(), "mkdocs"); + assert_eq!(sourced.per_file_flavor.value["**/*.mdx"].to_string(), "mdx"); +} + +#[test] +fn config_export_preserves_first_match_flavor_order() { + let dir = tempdir().unwrap(); + let config = "[per-file-flavor]\n\"docs/legacy/**\" = \"standard\"\n\"docs/**\" = \"mkdocs\"\n"; + fs::write(dir.path().join(".rumdl.toml"), config).unwrap(); + for format in ["json", "toml"] { + let output = Command::new(rumdl_bin()) + .current_dir(dir.path()) + .args(["config", "--output", format]) + .output() + .unwrap(); + assert!( + output.status.success(), + "{format}: {}", + String::from_utf8_lossy(&output.stderr) + ); + let stdout = String::from_utf8(output.stdout).unwrap(); + let specific = stdout.find("\"docs/legacy/**\"").unwrap(); + let broad = stdout.find("\"docs/**\"").unwrap(); + assert!( + specific < broad, + "{format} reordered the overlapping patterns:\n{stdout}" + ); + } } #[test] ++++++ rumdl.obsinfo ++++++ --- /var/tmp/diff_new_pack.K7Bdpf/_old 2026-11-30 14:29:14.064098107 +0100 +++ /var/tmp/diff_new_pack.K7Bdpf/_new 2026-11-30 14:29:14.068098276 +0100 @@ -1,5 +1,5 @@ name: rumdl -version: 0.3.8 -mtime: 1795797283 -commit: cf01e14c3191e771caaaf2e3d79e2f3cc556453d +version: 0.3.9 +mtime: 1795895992 +commit: 37b8ddd977f5915c83282dceb78e19ac2b2f4308 ++++++ vendor.tar.zst ++++++ /work/SRC/openSUSE:Factory/rumdl/vendor.tar.zst /work/SRC/openSUSE:Factory/.rumdl.new.1340718/vendor.tar.zst differ: char 7, line 1
