rumdl 0.0.184__py3-none-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rumdl/__init__.py +11 -0
- rumdl/__main__.py +57 -0
- rumdl/py.typed +0 -0
- rumdl-0.0.184.data/scripts/rumdl +0 -0
- rumdl-0.0.184.dist-info/METADATA +1008 -0
- rumdl-0.0.184.dist-info/RECORD +8 -0
- rumdl-0.0.184.dist-info/WHEEL +4 -0
- rumdl-0.0.184.dist-info/licenses/LICENSE +21 -0
rumdl/__init__.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""
|
|
2
|
+
rumdl: An extremely fast Markdown linter written in Rust.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
from importlib.metadata import version
|
|
7
|
+
__version__ = version("rumdl")
|
|
8
|
+
except ImportError:
|
|
9
|
+
# Python < 3.8
|
|
10
|
+
from importlib_metadata import version
|
|
11
|
+
__version__ = version("rumdl")
|
rumdl/__main__.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Command-line interface for rumdl.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
import sys
|
|
9
|
+
import subprocess
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
def find_native_binary() -> str:
|
|
13
|
+
"""Find the native Rust binary, not the Python entry point script."""
|
|
14
|
+
# In development mode, use the target directory binary
|
|
15
|
+
project_root = Path(__file__).resolve().parent.parent.parent
|
|
16
|
+
target_binary = project_root / "target" / "release" / "rumdl"
|
|
17
|
+
if target_binary.exists() and not target_binary.is_dir():
|
|
18
|
+
return str(target_binary)
|
|
19
|
+
|
|
20
|
+
# For Windows, check for .exe extension
|
|
21
|
+
if sys.platform == "win32":
|
|
22
|
+
target_binary = project_root / "target" / "release" / "rumdl.exe"
|
|
23
|
+
if target_binary.exists() and not target_binary.is_dir():
|
|
24
|
+
return str(target_binary)
|
|
25
|
+
|
|
26
|
+
# If we can't find the binary, raise an error
|
|
27
|
+
raise FileNotFoundError(
|
|
28
|
+
"Could not find the native rumdl binary. "
|
|
29
|
+
"Please ensure it was built with 'cargo build --release'."
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
def main() -> int:
|
|
33
|
+
"""Run the rumdl command line tool."""
|
|
34
|
+
try:
|
|
35
|
+
# Find the native binary
|
|
36
|
+
native_binary = find_native_binary()
|
|
37
|
+
|
|
38
|
+
# Simply forward all arguments to the Rust binary
|
|
39
|
+
args = [native_binary] + sys.argv[1:]
|
|
40
|
+
|
|
41
|
+
# Run the binary
|
|
42
|
+
if sys.platform == "win32":
|
|
43
|
+
completed_process = subprocess.run(args)
|
|
44
|
+
return completed_process.returncode
|
|
45
|
+
else:
|
|
46
|
+
# On Unix-like systems, directly execute the binary for better signal handling
|
|
47
|
+
os.execv(native_binary, args)
|
|
48
|
+
return 0 # This line will never be reached on non-Windows platforms
|
|
49
|
+
except FileNotFoundError as e:
|
|
50
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
51
|
+
return 1
|
|
52
|
+
except Exception as e:
|
|
53
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
54
|
+
return 1
|
|
55
|
+
|
|
56
|
+
if __name__ == "__main__":
|
|
57
|
+
sys.exit(main())
|
rumdl/py.typed
ADDED
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1,1008 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rumdl
|
|
3
|
+
Version: 0.0.184
|
|
4
|
+
Classifier: Development Status :: 4 - Beta
|
|
5
|
+
Classifier: Environment :: Console
|
|
6
|
+
Classifier: Intended Audience :: Developers
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Rust
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
19
|
+
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Summary: A fast Markdown linter written in Rust
|
|
22
|
+
Home-Page: https://github.com/rvben/rumdl
|
|
23
|
+
Author-email: "Ruben J. Jongejan" <ruben.jongejan@gmail.com>
|
|
24
|
+
License: MIT
|
|
25
|
+
Requires-Python: >=3.7
|
|
26
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
27
|
+
Project-URL: Homepage, https://github.com/rvben/rumdl
|
|
28
|
+
Project-URL: Repository, https://github.com/rvben/rumdl.git
|
|
29
|
+
|
|
30
|
+
# rumdl - A high-performance Markdown linter, written in Rust
|
|
31
|
+
|
|
32
|
+
<div align="center">
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
[](https://github.com/rvben/rumdl/actions)
|
|
37
|
+
[](https://opensource.org/licenses/MIT) [](https://crates.io/crates/rumdl)
|
|
38
|
+
[](https://pypi.org/project/rumdl/) [](https://github.com/rvben/rumdl/releases/latest) [](https://github.com/rvben/rumdl/stargazers)
|
|
39
|
+
|
|
40
|
+
## A modern Markdown linter and formatter, built for speed with Rust
|
|
41
|
+
|
|
42
|
+
| [**Docs**](https://github.com/rvben/rumdl/blob/main/docs/RULES.md) | [**Rules**](https://github.com/rvben/rumdl/blob/main/docs/RULES.md) | [**Configuration**](#configuration) | [**vs markdownlint**](https://github.com/rvben/rumdl/blob/main/docs/markdownlint-comparison.md) |
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
## Quick Start
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Install using Cargo
|
|
50
|
+
cargo install rumdl
|
|
51
|
+
|
|
52
|
+
# Lint Markdown files in the current directory
|
|
53
|
+
rumdl check .
|
|
54
|
+
|
|
55
|
+
# Format files (exits 0 on success, even if unfixable violations remain)
|
|
56
|
+
rumdl fmt .
|
|
57
|
+
|
|
58
|
+
# Auto-fix and report unfixable violations (exits 1 if violations remain)
|
|
59
|
+
rumdl check --fix .
|
|
60
|
+
|
|
61
|
+
# Create a default configuration file
|
|
62
|
+
rumdl init
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Overview
|
|
66
|
+
|
|
67
|
+
rumdl is a high-performance Markdown linter and formatter that helps ensure consistency and best practices in your Markdown files. Inspired by [ruff](https://github.com/astral-sh/ruff) 's approach to
|
|
68
|
+
Python linting, rumdl brings similar speed and developer experience improvements to the Markdown ecosystem.
|
|
69
|
+
|
|
70
|
+
It offers:
|
|
71
|
+
|
|
72
|
+
- ⚡️ **Built for speed** with Rust - significantly faster than alternatives
|
|
73
|
+
- 🔍 **54 lint rules** covering common Markdown issues
|
|
74
|
+
- 🛠️ **Automatic formatting** with `--fix` for files and stdin/stdout
|
|
75
|
+
- 📦 **Zero dependencies** - single binary with no runtime requirements
|
|
76
|
+
- 🔧 **Highly configurable** with TOML-based config files
|
|
77
|
+
- 🌐 **Multiple installation options** - Rust, Python, standalone binaries
|
|
78
|
+
- 🐍 **Installable via pip** for Python users
|
|
79
|
+
- 📏 **Modern CLI** with detailed error reporting
|
|
80
|
+
- 🔄 **CI/CD friendly** with non-zero exit code on errors
|
|
81
|
+
|
|
82
|
+
### Performance
|
|
83
|
+
|
|
84
|
+
rumdl is designed for speed. Benchmarked on the [Rust Book](https://github.com/rust-lang/book) repository (478 markdown files, October 2025):
|
|
85
|
+
|
|
86
|
+

|
|
87
|
+
|
|
88
|
+
With intelligent caching, subsequent runs are even faster - rumdl only re-lints files that have changed, making it ideal for watch mode and editor integration.
|
|
89
|
+
|
|
90
|
+
## Table of Contents
|
|
91
|
+
|
|
92
|
+
- [rumdl - A high-performance Markdown linter, written in Rust](#rumdl---a-high-performance-markdown-linter-written-in-rust)
|
|
93
|
+
- [A modern Markdown linter and formatter, built for speed with Rust](#a-modern-markdown-linter-and-formatter-built-for-speed-with-rust)
|
|
94
|
+
- [Quick Start](#quick-start)
|
|
95
|
+
- [Overview](#overview)
|
|
96
|
+
- [Performance](#performance)
|
|
97
|
+
- [Table of Contents](#table-of-contents)
|
|
98
|
+
- [Installation](#installation)
|
|
99
|
+
- [Using Homebrew (macOS/Linux)](#using-homebrew-macoslinux)
|
|
100
|
+
- [Using Cargo (Rust)](#using-cargo-rust)
|
|
101
|
+
- [Using pip (Python)](#using-pip-python)
|
|
102
|
+
- [Using uv](#using-uv)
|
|
103
|
+
- [Using Nix (macOS/Linux)](#using-nix-macoslinux)
|
|
104
|
+
- [Download binary](#download-binary)
|
|
105
|
+
- [VS Code Extension](#vs-code-extension)
|
|
106
|
+
- [Usage](#usage)
|
|
107
|
+
- [Stdin/Stdout Formatting](#stdinstdout-formatting)
|
|
108
|
+
- [Editor Integration](#editor-integration)
|
|
109
|
+
- [Pre-commit Integration](#pre-commit-integration)
|
|
110
|
+
- [Excluding Files in Pre-commit](#excluding-files-in-pre-commit)
|
|
111
|
+
- [CI/CD Integration](#cicd-integration)
|
|
112
|
+
- [GitHub Actions](#github-actions)
|
|
113
|
+
- [Rules](#rules)
|
|
114
|
+
- [Command-line Interface](#command-line-interface)
|
|
115
|
+
- [Commands](#commands)
|
|
116
|
+
- [`check [PATHS...]`](#check-paths)
|
|
117
|
+
- [`fmt [PATHS...]`](#fmt-paths)
|
|
118
|
+
- [`init [OPTIONS]`](#init-options)
|
|
119
|
+
- [`import <FILE> [OPTIONS]`](#import-file-options)
|
|
120
|
+
- [`rule [<rule>]`](#rule-rule)
|
|
121
|
+
- [`config [OPTIONS] [COMMAND]`](#config-options-command)
|
|
122
|
+
- [`server [OPTIONS]`](#server-options)
|
|
123
|
+
- [`vscode [OPTIONS]`](#vscode-options)
|
|
124
|
+
- [`version`](#version)
|
|
125
|
+
- [Global Options](#global-options)
|
|
126
|
+
- [Exit Codes](#exit-codes)
|
|
127
|
+
- [Usage Examples](#usage-examples)
|
|
128
|
+
- [Configuration](#configuration)
|
|
129
|
+
- [Configuration Discovery](#configuration-discovery)
|
|
130
|
+
- [Editor Support (JSON Schema)](#editor-support-json-schema)
|
|
131
|
+
- [Global Configuration](#global-configuration)
|
|
132
|
+
- [Markdownlint Migration](#markdownlint-migration)
|
|
133
|
+
- [Inline Configuration](#inline-configuration)
|
|
134
|
+
- [Configuration File Example](#configuration-file-example)
|
|
135
|
+
- [Initializing Configuration](#initializing-configuration)
|
|
136
|
+
- [Configuration in pyproject.toml](#configuration-in-pyprojecttoml)
|
|
137
|
+
- [Configuration Output](#configuration-output)
|
|
138
|
+
- [Effective Configuration (`rumdl config`)](#effective-configuration-rumdl-config)
|
|
139
|
+
- [Example output](#example-output)
|
|
140
|
+
- [Defaults Only (`rumdl config --defaults`)](#defaults-only-rumdl-config---defaults)
|
|
141
|
+
- [Output Style](#output-style)
|
|
142
|
+
- [Output Format](#output-format)
|
|
143
|
+
- [Text Output (Default)](#text-output-default)
|
|
144
|
+
- [JSON Output](#json-output)
|
|
145
|
+
- [Development](#development)
|
|
146
|
+
- [Prerequisites](#prerequisites)
|
|
147
|
+
- [Building](#building)
|
|
148
|
+
- [Testing](#testing)
|
|
149
|
+
- [JSON Schema Generation](#json-schema-generation)
|
|
150
|
+
- [License](#license)
|
|
151
|
+
|
|
152
|
+
## Installation
|
|
153
|
+
|
|
154
|
+
Choose the installation method that works best for you:
|
|
155
|
+
|
|
156
|
+
### Using Homebrew (macOS/Linux)
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
brew install rumdl
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Using Cargo (Rust)
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
cargo install rumdl
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Using pip (Python)
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
pip install rumdl
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Using uv
|
|
175
|
+
|
|
176
|
+
For faster installation and better dependency management with [uv](https://github.com/astral-sh/uv):
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Install directly
|
|
180
|
+
uv tool install rumdl
|
|
181
|
+
|
|
182
|
+
# Or run without installing
|
|
183
|
+
uv tool run rumdl check .
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Using Nix (macOS/Linux)
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
nix-channel --update
|
|
190
|
+
nix-env --install --attr nixpkgs.rumdl
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Alternatively, you can use flakes to run it without installation.
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
nix run --extra-experimental-features 'flakes nix-command' nixpkgs/nixpkgs-unstable#rumdl -- --version
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Using Termux User Repository (TUR) (Android)
|
|
200
|
+
|
|
201
|
+
After enabling the TUR repo using
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
pkg install tur-repo
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
pkg install rumdl
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Download binary
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
# Linux/macOS
|
|
215
|
+
curl -LsSf https://github.com/rvben/rumdl/releases/latest/download/rumdl-linux-x86_64.tar.gz | tar xzf - -C /usr/local/bin
|
|
216
|
+
|
|
217
|
+
# Windows PowerShell
|
|
218
|
+
Invoke-WebRequest -Uri "https://github.com/rvben/rumdl/releases/latest/download/rumdl-windows-x86_64.zip" -OutFile "rumdl.zip"
|
|
219
|
+
Expand-Archive -Path "rumdl.zip" -DestinationPath "$env:USERPROFILE\.rumdl"
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### VS Code Extension
|
|
223
|
+
|
|
224
|
+
For the best development experience, install the rumdl VS Code extension directly from the command line:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
# Install the VS Code extension
|
|
228
|
+
rumdl vscode
|
|
229
|
+
|
|
230
|
+
# Check if the extension is installed
|
|
231
|
+
rumdl vscode --status
|
|
232
|
+
|
|
233
|
+
# Force reinstall the extension
|
|
234
|
+
rumdl vscode --force
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
The extension provides:
|
|
238
|
+
|
|
239
|
+
- 🔍 Real-time linting as you type
|
|
240
|
+
- 💡 Quick fixes for common issues
|
|
241
|
+
- 🎨 Code formatting on save
|
|
242
|
+
- 📋 Hover tooltips with rule documentation
|
|
243
|
+
- ⚡ Lightning-fast performance with zero lag
|
|
244
|
+
|
|
245
|
+
The CLI will automatically detect VS Code, Cursor, or Windsurf and install the appropriate extension. See the
|
|
246
|
+
[VS Code extension documentation](https://github.com/rvben/rumdl/blob/main/docs/vscode-extension.md) for more details.
|
|
247
|
+
|
|
248
|
+
## Usage
|
|
249
|
+
|
|
250
|
+
Getting started with rumdl is simple:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
# Lint a single file
|
|
254
|
+
rumdl check README.md
|
|
255
|
+
|
|
256
|
+
# Lint all Markdown files in current directory and subdirectories
|
|
257
|
+
rumdl check .
|
|
258
|
+
|
|
259
|
+
# Format a specific file
|
|
260
|
+
rumdl fmt README.md
|
|
261
|
+
|
|
262
|
+
# Create a default configuration file
|
|
263
|
+
rumdl init
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Common usage examples:
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
# Lint with custom configuration
|
|
270
|
+
rumdl check --config my-config.toml docs/
|
|
271
|
+
|
|
272
|
+
# Disable specific rules
|
|
273
|
+
rumdl check --disable MD013,MD033 README.md
|
|
274
|
+
|
|
275
|
+
# Enable only specific rules
|
|
276
|
+
rumdl check --enable MD001,MD003 README.md
|
|
277
|
+
|
|
278
|
+
# Exclude specific files/directories
|
|
279
|
+
rumdl check --exclude "node_modules,dist" .
|
|
280
|
+
|
|
281
|
+
# Include only specific files/directories
|
|
282
|
+
rumdl check --include "docs/*.md,README.md" .
|
|
283
|
+
|
|
284
|
+
# Watch mode for continuous linting
|
|
285
|
+
rumdl check --watch docs/
|
|
286
|
+
|
|
287
|
+
# Combine include and exclude patterns
|
|
288
|
+
rumdl check --include "docs/**/*.md" --exclude "docs/temp,docs/drafts" .
|
|
289
|
+
|
|
290
|
+
# Don't respect gitignore files (note: --respect-gitignore defaults to true)
|
|
291
|
+
rumdl check --respect-gitignore=false .
|
|
292
|
+
|
|
293
|
+
# Force exclude patterns even for explicitly specified files (useful for pre-commit)
|
|
294
|
+
rumdl check excluded.md --force-exclude # Will respect exclude patterns in config
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Stdin/Stdout Formatting
|
|
298
|
+
|
|
299
|
+
rumdl supports formatting via stdin/stdout, making it ideal for editor integrations and CI pipelines:
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
# Format content from stdin and output to stdout
|
|
303
|
+
cat README.md | rumdl fmt - > README_formatted.md
|
|
304
|
+
# Alternative: cat README.md | rumdl fmt --stdin > README_formatted.md
|
|
305
|
+
|
|
306
|
+
# Use in a pipeline
|
|
307
|
+
echo "# Title " | rumdl fmt -
|
|
308
|
+
# Output: # Title
|
|
309
|
+
|
|
310
|
+
# Format clipboard content (macOS example)
|
|
311
|
+
pbpaste | rumdl fmt - | pbcopy
|
|
312
|
+
|
|
313
|
+
# Provide filename context for better error messages (useful for editor integrations)
|
|
314
|
+
cat README.md | rumdl check - --stdin-filename README.md
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Editor Integration
|
|
318
|
+
|
|
319
|
+
For editor integration, use stdin/stdout mode with the `--quiet` flag to suppress diagnostic messages:
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
# Format selection in editor (example for vim)
|
|
323
|
+
:'<,'>!rumdl fmt - --quiet
|
|
324
|
+
|
|
325
|
+
# Format entire buffer
|
|
326
|
+
:%!rumdl fmt - --quiet
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## Pre-commit Integration
|
|
330
|
+
|
|
331
|
+
You can use `rumdl` as a pre-commit hook to check and fix your Markdown files.
|
|
332
|
+
|
|
333
|
+
The recommended way is to use the official pre-commit hook repository:
|
|
334
|
+
|
|
335
|
+
[rumdl-pre-commit repository](https://github.com/rvben/rumdl-pre-commit)
|
|
336
|
+
|
|
337
|
+
Add the following to your `.pre-commit-config.yaml`:
|
|
338
|
+
|
|
339
|
+
```yaml
|
|
340
|
+
repos:
|
|
341
|
+
- repo: https://github.com/rvben/rumdl-pre-commit
|
|
342
|
+
rev: v0.0.99 # Use the latest release tag
|
|
343
|
+
hooks:
|
|
344
|
+
- id: rumdl
|
|
345
|
+
# To only check (default):
|
|
346
|
+
# args: []
|
|
347
|
+
# To automatically fix issues:
|
|
348
|
+
# args: [--fix]
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
- By default, the hook will only check for issues.
|
|
352
|
+
- To automatically fix issues, add `args: [--fix]` to the hook configuration.
|
|
353
|
+
|
|
354
|
+
When you run `pre-commit install` or `pre-commit run`, pre-commit will automatically install `rumdl` in an isolated Python environment using pip. You do **not** need to install rumdl manually.
|
|
355
|
+
|
|
356
|
+
### Excluding Files in Pre-commit
|
|
357
|
+
|
|
358
|
+
By default, when pre-commit passes files explicitly to rumdl, the exclude patterns in your `.rumdl.toml` configuration file are ignored. This is intentional behavior - if you explicitly specify a
|
|
359
|
+
file, it gets checked.
|
|
360
|
+
|
|
361
|
+
However, for pre-commit workflows where you want to exclude certain files even when they're passed explicitly, you have two options:
|
|
362
|
+
|
|
363
|
+
1. **Use `force_exclude` in your configuration file:**
|
|
364
|
+
|
|
365
|
+
```toml
|
|
366
|
+
# .rumdl.toml
|
|
367
|
+
[global]
|
|
368
|
+
exclude = ["generated/*.md", "vendor/**"]
|
|
369
|
+
force_exclude = true # Enforce excludes even for explicitly provided files
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
2. **Use the `--force-exclude` flag in your pre-commit config:**
|
|
373
|
+
|
|
374
|
+
```yaml
|
|
375
|
+
repos:
|
|
376
|
+
- repo: https://github.com/rvben/rumdl-pre-commit
|
|
377
|
+
rev: v0.0.99
|
|
378
|
+
hooks:
|
|
379
|
+
- id: rumdl
|
|
380
|
+
args: [--force-exclude] # Respect exclude patterns from config
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
## CI/CD Integration
|
|
384
|
+
|
|
385
|
+
### GitHub Actions
|
|
386
|
+
|
|
387
|
+
rumdl can output annotations directly in GitHub Actions format, making issues appear inline in pull requests:
|
|
388
|
+
|
|
389
|
+
```yaml
|
|
390
|
+
- name: Lint Markdown
|
|
391
|
+
run: rumdl check --output-format github .
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
This produces annotations that GitHub automatically displays in the PR's "Files changed" tab. Supports error/warning severity levels and precise issue locations.
|
|
395
|
+
|
|
396
|
+
## Rules
|
|
397
|
+
|
|
398
|
+
rumdl implements 54 lint rules for Markdown files. Here are some key rule categories:
|
|
399
|
+
|
|
400
|
+
| Category | Description | Example Rules |
|
|
401
|
+
| -------------- | ---------------------------------------- | ------------------- |
|
|
402
|
+
| **Headings** | Proper heading structure and formatting | MD001, MD002, MD003 |
|
|
403
|
+
| **Lists** | Consistent list formatting and structure | MD004, MD005, MD007 |
|
|
404
|
+
| **Whitespace** | Proper spacing and line length | MD009, MD010, MD012 |
|
|
405
|
+
| **Code** | Code block formatting and language tags | MD040, MD046, MD048 |
|
|
406
|
+
| **Links** | Proper link and reference formatting | MD034, MD039, MD042 |
|
|
407
|
+
| **Images** | Image alt text and references | MD045, MD052 |
|
|
408
|
+
| **Style** | Consistent style across document | MD031, MD032, MD035 |
|
|
409
|
+
|
|
410
|
+
For a complete list of rules and their descriptions, see our [documentation](https://github.com/rvben/rumdl/blob/main/docs/RULES.md) or run:
|
|
411
|
+
|
|
412
|
+
```bash
|
|
413
|
+
rumdl rule
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
## Command-line Interface
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
rumdl <command> [options] [file or directory...]
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
### Commands
|
|
423
|
+
|
|
424
|
+
#### `check [PATHS...]`
|
|
425
|
+
|
|
426
|
+
Lint Markdown files and print warnings/errors (main subcommand)
|
|
427
|
+
|
|
428
|
+
**Arguments:**
|
|
429
|
+
|
|
430
|
+
- `[PATHS...]`: Files or directories to lint. If provided, these paths take precedence over include patterns
|
|
431
|
+
|
|
432
|
+
**Options:**
|
|
433
|
+
|
|
434
|
+
- `-f, --fix`: Automatically fix issues where possible
|
|
435
|
+
- `--diff`: Show diff of what would be fixed instead of fixing files
|
|
436
|
+
- `-w, --watch`: Run in watch mode by re-running whenever files change
|
|
437
|
+
- `-l, --list-rules`: List all available rules
|
|
438
|
+
- `-d, --disable <rules>`: Disable specific rules (comma-separated)
|
|
439
|
+
- `-e, --enable <rules>`: Enable only specific rules (comma-separated)
|
|
440
|
+
- `--exclude <patterns>`: Exclude specific files or directories (comma-separated glob patterns)
|
|
441
|
+
- `--include <patterns>`: Include only specific files or directories (comma-separated glob patterns)
|
|
442
|
+
- `--respect-gitignore`: Respect .gitignore files when scanning directories (does not apply to explicitly provided paths)
|
|
443
|
+
- `--force-exclude`: Enforce exclude patterns even for explicitly specified files (useful for pre-commit hooks)
|
|
444
|
+
- `-v, --verbose`: Show detailed output
|
|
445
|
+
- `--profile`: Show profiling information
|
|
446
|
+
- `--statistics`: Show rule violation statistics summary
|
|
447
|
+
- `-q, --quiet`: Quiet mode
|
|
448
|
+
- `-o, --output <format>`: Output format: `text` (default) or `json`
|
|
449
|
+
- `--stdin`: Read from stdin instead of files
|
|
450
|
+
|
|
451
|
+
#### `fmt [PATHS...]`
|
|
452
|
+
|
|
453
|
+
Format Markdown files and output the result. Always exits with code 0 on successful formatting, making it ideal for editor integration.
|
|
454
|
+
|
|
455
|
+
**Arguments:**
|
|
456
|
+
|
|
457
|
+
- `[PATHS...]`: Files or directories to format. If provided, these paths take precedence over include patterns
|
|
458
|
+
|
|
459
|
+
**Options:**
|
|
460
|
+
|
|
461
|
+
All the same options as `check` are available (except `--fix` which is always enabled), including:
|
|
462
|
+
|
|
463
|
+
- `--stdin`: Format content from stdin and output to stdout
|
|
464
|
+
- `-d, --disable <rules>`: Disable specific rules during formatting
|
|
465
|
+
- `-e, --enable <rules>`: Format using only specific rules
|
|
466
|
+
- `--exclude/--include`: Control which files to format
|
|
467
|
+
- `-q, --quiet`: Suppress diagnostic output
|
|
468
|
+
|
|
469
|
+
**Examples:**
|
|
470
|
+
|
|
471
|
+
```bash
|
|
472
|
+
# Format all Markdown files in current directory
|
|
473
|
+
rumdl fmt
|
|
474
|
+
|
|
475
|
+
# Format specific file
|
|
476
|
+
rumdl fmt README.md
|
|
477
|
+
|
|
478
|
+
# Format from stdin (using dash syntax)
|
|
479
|
+
cat README.md | rumdl fmt - > formatted.md
|
|
480
|
+
# Alternative: cat README.md | rumdl fmt --stdin > formatted.md
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
#### `init [OPTIONS]`
|
|
484
|
+
|
|
485
|
+
Create a default configuration file in the current directory
|
|
486
|
+
|
|
487
|
+
**Options:**
|
|
488
|
+
|
|
489
|
+
- `--pyproject`: Generate configuration for `pyproject.toml` instead of `.rumdl.toml`
|
|
490
|
+
|
|
491
|
+
#### `import <FILE> [OPTIONS]`
|
|
492
|
+
|
|
493
|
+
Import and convert markdownlint configuration files to rumdl format
|
|
494
|
+
|
|
495
|
+
**Arguments:**
|
|
496
|
+
|
|
497
|
+
- `<FILE>`: Path to markdownlint config file (JSON/YAML)
|
|
498
|
+
|
|
499
|
+
**Options:**
|
|
500
|
+
|
|
501
|
+
- `-o, --output <path>`: Output file path (default: `.rumdl.toml`)
|
|
502
|
+
- `--format <format>`: Output format: `toml` or `json` (default: `toml`)
|
|
503
|
+
- `--dry-run`: Show converted config without writing to file
|
|
504
|
+
|
|
505
|
+
#### `rule [<rule>]`
|
|
506
|
+
|
|
507
|
+
Show information about a rule or list all rules
|
|
508
|
+
|
|
509
|
+
**Arguments:**
|
|
510
|
+
|
|
511
|
+
- `[rule]`: Rule name or ID (optional). If provided, shows details for that rule. If omitted, lists all available rules
|
|
512
|
+
|
|
513
|
+
#### `config [OPTIONS] [COMMAND]`
|
|
514
|
+
|
|
515
|
+
Show configuration or query a specific key
|
|
516
|
+
|
|
517
|
+
**Options:**
|
|
518
|
+
|
|
519
|
+
- `--defaults`: Show only the default configuration values
|
|
520
|
+
- `--output <format>`: Output format (e.g. `toml`, `json`)
|
|
521
|
+
|
|
522
|
+
**Subcommands:**
|
|
523
|
+
|
|
524
|
+
- `get <key>`: Query a specific config key (e.g. `global.exclude` or `MD013.line_length`)
|
|
525
|
+
- `file`: Show the absolute path of the configuration file that was loaded
|
|
526
|
+
|
|
527
|
+
#### `server [OPTIONS]`
|
|
528
|
+
|
|
529
|
+
Start the Language Server Protocol server for editor integration
|
|
530
|
+
|
|
531
|
+
**Options:**
|
|
532
|
+
|
|
533
|
+
- `--port <PORT>`: TCP port to listen on (for debugging)
|
|
534
|
+
- `--stdio`: Use stdio for communication (default)
|
|
535
|
+
- `-v, --verbose`: Enable verbose logging
|
|
536
|
+
|
|
537
|
+
#### `vscode [OPTIONS]`
|
|
538
|
+
|
|
539
|
+
Install the rumdl VS Code extension
|
|
540
|
+
|
|
541
|
+
**Options:**
|
|
542
|
+
|
|
543
|
+
- `--force`: Force reinstall even if already installed
|
|
544
|
+
- `--status`: Show installation status without installing
|
|
545
|
+
|
|
546
|
+
#### `version`
|
|
547
|
+
|
|
548
|
+
Show version information
|
|
549
|
+
|
|
550
|
+
### Global Options
|
|
551
|
+
|
|
552
|
+
These options are available for all commands:
|
|
553
|
+
|
|
554
|
+
- `--color <mode>`: Control colored output: `auto` (default), `always`, `never`
|
|
555
|
+
- `--config <file>`: Path to configuration file
|
|
556
|
+
- `--no-config`: Ignore all configuration files and use built-in defaults
|
|
557
|
+
|
|
558
|
+
### Exit Codes
|
|
559
|
+
|
|
560
|
+
- `0`: Success
|
|
561
|
+
- `1`: Violations found (or remain after `--fix`)
|
|
562
|
+
- `2`: Tool error
|
|
563
|
+
|
|
564
|
+
**Note:** `rumdl fmt` exits 0 on successful formatting (even if unfixable violations remain), making it compatible with editor integrations. `rumdl check --fix` exits 1 if violations remain, useful
|
|
565
|
+
for pre-commit hooks.
|
|
566
|
+
|
|
567
|
+
### Usage Examples
|
|
568
|
+
|
|
569
|
+
```bash
|
|
570
|
+
# Lint all Markdown files in the current directory
|
|
571
|
+
rumdl check .
|
|
572
|
+
|
|
573
|
+
# Format files (exits 0 on success, even if unfixable violations remain)
|
|
574
|
+
rumdl fmt .
|
|
575
|
+
|
|
576
|
+
# Auto-fix and report unfixable violations (exits 1 if violations remain)
|
|
577
|
+
rumdl check --fix .
|
|
578
|
+
|
|
579
|
+
# Preview what would be fixed without modifying files
|
|
580
|
+
rumdl check --diff .
|
|
581
|
+
|
|
582
|
+
# Create a default configuration file
|
|
583
|
+
rumdl init
|
|
584
|
+
|
|
585
|
+
# Create or update a pyproject.toml file with rumdl configuration
|
|
586
|
+
rumdl init --pyproject
|
|
587
|
+
|
|
588
|
+
# Import a markdownlint config file
|
|
589
|
+
rumdl import .markdownlint.json
|
|
590
|
+
|
|
591
|
+
# Convert markdownlint config to JSON format
|
|
592
|
+
rumdl import --format json .markdownlint.yaml --output rumdl-config.json
|
|
593
|
+
|
|
594
|
+
# Preview conversion without writing file
|
|
595
|
+
rumdl import --dry-run .markdownlint.json
|
|
596
|
+
|
|
597
|
+
# Show information about a specific rule
|
|
598
|
+
rumdl rule MD013
|
|
599
|
+
|
|
600
|
+
# List all available rules
|
|
601
|
+
rumdl rule
|
|
602
|
+
|
|
603
|
+
# Query a specific config key
|
|
604
|
+
rumdl config get global.exclude
|
|
605
|
+
|
|
606
|
+
# Show the path of the loaded configuration file
|
|
607
|
+
rumdl config file
|
|
608
|
+
|
|
609
|
+
# Show configuration as JSON instead of the default format
|
|
610
|
+
rumdl config --output json
|
|
611
|
+
|
|
612
|
+
# Lint content from stdin
|
|
613
|
+
echo "# My Heading" | rumdl check --stdin
|
|
614
|
+
|
|
615
|
+
# Get JSON output for integration with other tools
|
|
616
|
+
rumdl check --output json README.md
|
|
617
|
+
|
|
618
|
+
# Show statistics summary of rule violations
|
|
619
|
+
rumdl check --statistics .
|
|
620
|
+
|
|
621
|
+
# Disable colors in output
|
|
622
|
+
rumdl check --color never README.md
|
|
623
|
+
|
|
624
|
+
# Use built-in defaults, ignoring all config files
|
|
625
|
+
rumdl check --no-config README.md
|
|
626
|
+
|
|
627
|
+
# Show version information
|
|
628
|
+
rumdl version
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
## Configuration
|
|
632
|
+
|
|
633
|
+
rumdl can be configured in several ways:
|
|
634
|
+
|
|
635
|
+
1. Using a `.rumdl.toml` or `rumdl.toml` file in your project directory or parent directories
|
|
636
|
+
2. Using a `.config/rumdl.toml` file (following the [config-dir convention](https://github.com/pi0/config-dir))
|
|
637
|
+
3. Using the `[tool.rumdl]` section in your project's `pyproject.toml` file (for Python projects)
|
|
638
|
+
4. Using command-line arguments
|
|
639
|
+
5. **Automatic markdownlint compatibility**: rumdl automatically discovers and loads existing markdownlint config files (`.markdownlint.json`, `.markdownlint.yaml`, etc.)
|
|
640
|
+
|
|
641
|
+
### Configuration Discovery
|
|
642
|
+
|
|
643
|
+
rumdl automatically searches for configuration files by traversing up the directory tree from the current working directory, similar to tools like `git` , `ruff` , and `eslint` . This means you can
|
|
644
|
+
run rumdl from any subdirectory of your project and it will find the configuration file at the project root.
|
|
645
|
+
|
|
646
|
+
The search follows these rules:
|
|
647
|
+
|
|
648
|
+
- Searches upward for `.rumdl.toml`, `rumdl.toml`, `.config/rumdl.toml`, or `pyproject.toml` (with `[tool.rumdl]` section)
|
|
649
|
+
- Precedence order: `.rumdl.toml` > `rumdl.toml` > `.config/rumdl.toml` > `pyproject.toml`
|
|
650
|
+
- Stops at the first configuration file found
|
|
651
|
+
- Stops searching when it encounters a `.git` directory (project boundary)
|
|
652
|
+
- Maximum traversal depth of 100 directories
|
|
653
|
+
- Falls back to user configuration if no project configuration is found (see Global Configuration below)
|
|
654
|
+
|
|
655
|
+
To disable all configuration discovery and use only built-in defaults, use the `--isolated` flag:
|
|
656
|
+
|
|
657
|
+
```bash
|
|
658
|
+
# Use discovered configuration (default behavior)
|
|
659
|
+
rumdl check .
|
|
660
|
+
|
|
661
|
+
# Ignore all configuration files
|
|
662
|
+
rumdl check --isolated .
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
### Editor Support (JSON Schema)
|
|
666
|
+
|
|
667
|
+
rumdl provides a JSON Schema for `.rumdl.toml` configuration files, enabling autocomplete, validation, and inline documentation in supported editors like VS Code, IntelliJ IDEA, and others.
|
|
668
|
+
|
|
669
|
+
The schema is available at `https://raw.githubusercontent.com/rvben/rumdl/main/rumdl.schema.json`.
|
|
670
|
+
|
|
671
|
+
**VS Code Setup:**
|
|
672
|
+
|
|
673
|
+
1. Install the "Even Better TOML" extension
|
|
674
|
+
2. The schema will be automatically associated with `.rumdl.toml` and `rumdl.toml` files once submitted to SchemaStore
|
|
675
|
+
|
|
676
|
+
**Manual Schema Association:**
|
|
677
|
+
|
|
678
|
+
Add this to your `.rumdl.toml` file (in a comment, as TOML doesn't support `$schema`):
|
|
679
|
+
|
|
680
|
+
```toml
|
|
681
|
+
# yaml-language-server: $schema=https://raw.githubusercontent.com/rvben/rumdl/main/rumdl.schema.json
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
This enables IntelliSense, validation, and hover documentation for all configuration options.
|
|
685
|
+
|
|
686
|
+
### Global Configuration
|
|
687
|
+
|
|
688
|
+
When no project configuration is found, rumdl will check for a user-level configuration file in your platform's standard config directory:
|
|
689
|
+
|
|
690
|
+
**Location:**
|
|
691
|
+
|
|
692
|
+
- **Linux/macOS**: `~/.config/rumdl/` (respects `XDG_CONFIG_HOME` if set)
|
|
693
|
+
- **Windows**: `%APPDATA%\rumdl\`
|
|
694
|
+
|
|
695
|
+
**Files checked (in order):**
|
|
696
|
+
|
|
697
|
+
1. `.rumdl.toml`
|
|
698
|
+
2. `rumdl.toml`
|
|
699
|
+
3. `pyproject.toml` (must contain `[tool.rumdl]` section)
|
|
700
|
+
|
|
701
|
+
This allows you to set personal preferences that apply to all projects without local configuration.
|
|
702
|
+
|
|
703
|
+
**Example:** Create `~/.config/rumdl/rumdl.toml`:
|
|
704
|
+
|
|
705
|
+
```toml
|
|
706
|
+
[global]
|
|
707
|
+
line-length = 100
|
|
708
|
+
disable = ["MD013", "MD041"]
|
|
709
|
+
|
|
710
|
+
[MD007]
|
|
711
|
+
indent = 2
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
**Note:** User configuration is only used when no project configuration exists. Project configurations always take precedence.
|
|
715
|
+
|
|
716
|
+
### Markdownlint Migration
|
|
717
|
+
|
|
718
|
+
rumdl provides seamless compatibility with existing markdownlint configurations:
|
|
719
|
+
|
|
720
|
+
** Automatic Discovery**: rumdl automatically detects and loads markdownlint config files:
|
|
721
|
+
|
|
722
|
+
- `.markdownlint.json` / `.markdownlint.jsonc`
|
|
723
|
+
- `.markdownlint.yaml` / `.markdownlint.yml`
|
|
724
|
+
- `markdownlint.json` / `markdownlint.yaml`
|
|
725
|
+
|
|
726
|
+
** Explicit Import**: Convert markdownlint configs to rumdl format:
|
|
727
|
+
|
|
728
|
+
```bash
|
|
729
|
+
# Convert to .rumdl.toml
|
|
730
|
+
rumdl import .markdownlint.json
|
|
731
|
+
|
|
732
|
+
# Convert to JSON format
|
|
733
|
+
rumdl import --format json .markdownlint.yaml --output config.json
|
|
734
|
+
|
|
735
|
+
# Preview conversion
|
|
736
|
+
rumdl import --dry-run .markdownlint.json
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
For comprehensive documentation on global settings (file selection, rule enablement, etc.), see our [Global Settings Reference](docs/global-settings.md).
|
|
740
|
+
|
|
741
|
+
### Inline Configuration
|
|
742
|
+
|
|
743
|
+
rumdl supports inline HTML comments to disable or configure rules for specific sections of your Markdown files. This is useful for making exceptions without changing global configuration:
|
|
744
|
+
|
|
745
|
+
```markdown
|
|
746
|
+
<!-- rumdl-disable MD013 -->
|
|
747
|
+
This line can be as long as needed without triggering the line length rule.
|
|
748
|
+
<!-- rumdl-enable MD013 -->
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
Note: `markdownlint-disable`/`markdownlint-enable` comments are also supported for compatibility with existing markdownlint configurations.
|
|
752
|
+
|
|
753
|
+
For complete documentation on inline configuration options, see our [Inline Configuration Reference](docs/inline-configuration.md).
|
|
754
|
+
|
|
755
|
+
### Configuration File Example
|
|
756
|
+
|
|
757
|
+
Here's an example `.rumdl.toml` configuration file:
|
|
758
|
+
|
|
759
|
+
```toml
|
|
760
|
+
# Global settings
|
|
761
|
+
line-length = 100
|
|
762
|
+
exclude = ["node_modules", "build", "dist"]
|
|
763
|
+
respect-gitignore = true
|
|
764
|
+
|
|
765
|
+
# Disable specific rules
|
|
766
|
+
disabled-rules = ["MD013", "MD033"]
|
|
767
|
+
|
|
768
|
+
# Disable specific rules for specific files
|
|
769
|
+
[per-file-ignores]
|
|
770
|
+
"README.md" = ["MD033"] # Allow HTML in README
|
|
771
|
+
"SUMMARY.md" = ["MD025"] # Allow multiple H1 in table of contents
|
|
772
|
+
"docs/api/**/*.md" = ["MD013", "MD041"] # Relax rules for generated docs
|
|
773
|
+
|
|
774
|
+
# Configure individual rules
|
|
775
|
+
[MD007]
|
|
776
|
+
indent = 2
|
|
777
|
+
|
|
778
|
+
[MD013]
|
|
779
|
+
line-length = 100
|
|
780
|
+
code-blocks = false
|
|
781
|
+
tables = false
|
|
782
|
+
reflow = true # Enable automatic line wrapping (required for --fix)
|
|
783
|
+
|
|
784
|
+
[MD025]
|
|
785
|
+
level = 1
|
|
786
|
+
front-matter-title = "title"
|
|
787
|
+
|
|
788
|
+
[MD044]
|
|
789
|
+
names = ["rumdl", "Markdown", "GitHub"]
|
|
790
|
+
|
|
791
|
+
[MD048]
|
|
792
|
+
code-fence-style = "backtick"
|
|
793
|
+
```
|
|
794
|
+
|
|
795
|
+
### Initializing Configuration
|
|
796
|
+
|
|
797
|
+
To create a configuration file, use the `init` command:
|
|
798
|
+
|
|
799
|
+
```bash
|
|
800
|
+
# Create a .rumdl.toml file (for any project)
|
|
801
|
+
rumdl init
|
|
802
|
+
|
|
803
|
+
# Create or update a pyproject.toml file with rumdl configuration (for Python projects)
|
|
804
|
+
rumdl init --pyproject
|
|
805
|
+
```
|
|
806
|
+
|
|
807
|
+
### Configuration in pyproject.toml
|
|
808
|
+
|
|
809
|
+
For Python projects, you can include rumdl configuration in your `pyproject.toml` file, keeping all project configuration in one place. Example:
|
|
810
|
+
|
|
811
|
+
```toml
|
|
812
|
+
[tool.rumdl]
|
|
813
|
+
# Global options at root level
|
|
814
|
+
line-length = 100
|
|
815
|
+
disable = ["MD033"]
|
|
816
|
+
include = ["docs/*.md", "README.md"]
|
|
817
|
+
exclude = [".git", "node_modules"]
|
|
818
|
+
ignore-gitignore = false
|
|
819
|
+
|
|
820
|
+
# Rule-specific configuration
|
|
821
|
+
[tool.rumdl.MD013]
|
|
822
|
+
code_blocks = false
|
|
823
|
+
tables = false
|
|
824
|
+
|
|
825
|
+
[tool.rumdl.MD044]
|
|
826
|
+
names = ["rumdl", "Markdown", "GitHub"]
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
Both kebab-case (`line-length`, `ignore-gitignore`) and snake_case (`line_length`, `ignore_gitignore`) formats are supported for compatibility with different Python tooling conventions.
|
|
830
|
+
|
|
831
|
+
### Configuration Output
|
|
832
|
+
|
|
833
|
+
#### Effective Configuration (`rumdl config`)
|
|
834
|
+
|
|
835
|
+
The `rumdl config` command prints the **full effective configuration** (defaults + all overrides), showing every key and its value, annotated with the source of each value. The output is colorized and
|
|
836
|
+
the `[from ...]` annotation is globally aligned for easy scanning.
|
|
837
|
+
|
|
838
|
+
#### Example output
|
|
839
|
+
|
|
840
|
+
```text
|
|
841
|
+
[global]
|
|
842
|
+
enable = [] [from default]
|
|
843
|
+
disable = ["MD033"] [from .rumdl.toml]
|
|
844
|
+
include = ["README.md"] [from .rumdl.toml]
|
|
845
|
+
respect_gitignore = true [from .rumdl.toml]
|
|
846
|
+
|
|
847
|
+
[MD013]
|
|
848
|
+
line_length = 200 [from .rumdl.toml]
|
|
849
|
+
code_blocks = true [from .rumdl.toml]
|
|
850
|
+
...
|
|
851
|
+
```
|
|
852
|
+
|
|
853
|
+
- ** Keys** are cyan, **values** are yellow, and the `[from ...]` annotation is colored by source:
|
|
854
|
+
- Green: CLI
|
|
855
|
+
- Blue: `.rumdl.toml`
|
|
856
|
+
- Magenta: `pyproject.toml`
|
|
857
|
+
- Yellow: default
|
|
858
|
+
- The `[from ...]` column is aligned across all sections.
|
|
859
|
+
|
|
860
|
+
### Defaults Only (`rumdl config --defaults`)
|
|
861
|
+
|
|
862
|
+
The `--defaults` flag prints only the default configuration as TOML, suitable for copy-paste or reference:
|
|
863
|
+
|
|
864
|
+
```toml
|
|
865
|
+
[global]
|
|
866
|
+
enable = []
|
|
867
|
+
disable = []
|
|
868
|
+
exclude = []
|
|
869
|
+
include = []
|
|
870
|
+
respect_gitignore = true
|
|
871
|
+
force_exclude = false # Set to true to exclude files even when explicitly specified
|
|
872
|
+
|
|
873
|
+
[MD013]
|
|
874
|
+
line_length = 80
|
|
875
|
+
code_blocks = true
|
|
876
|
+
...
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
## Output Style
|
|
880
|
+
|
|
881
|
+
rumdl produces clean, colorized output similar to modern linting tools:
|
|
882
|
+
|
|
883
|
+
```text
|
|
884
|
+
README.md:12:1: [MD022] Headings should be surrounded by blank lines [*]
|
|
885
|
+
README.md:24:5: [MD037] Spaces inside emphasis markers: "* incorrect *" [*]
|
|
886
|
+
README.md:31:76: [MD013] Line length exceeds 80 characters
|
|
887
|
+
README.md:42:3: [MD010] Hard tabs found, use spaces instead [*]
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
When running with `--fix`, rumdl shows which issues were fixed:
|
|
891
|
+
|
|
892
|
+
```text
|
|
893
|
+
README.md:12:1: [MD022] Headings should be surrounded by blank lines [fixed]
|
|
894
|
+
README.md:24:5: [MD037] Spaces inside emphasis markers: "* incorrect *" [fixed]
|
|
895
|
+
README.md:42:3: [MD010] Hard tabs found, use spaces instead [fixed]
|
|
896
|
+
|
|
897
|
+
Fixed 3 issues in 1 file
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
For a more detailed view, use the `--verbose` option:
|
|
901
|
+
|
|
902
|
+
```text
|
|
903
|
+
✓ No issues found in CONTRIBUTING.md
|
|
904
|
+
README.md:12:1: [MD022] Headings should be surrounded by blank lines [*]
|
|
905
|
+
README.md:24:5: [MD037] Spaces inside emphasis markers: "* incorrect *" [*]
|
|
906
|
+
README.md:42:3: [MD010] Hard tabs found, use spaces instead [*]
|
|
907
|
+
|
|
908
|
+
Found 3 issues in 1 file (2 files checked)
|
|
909
|
+
Run `rumdl fmt` to automatically fix issues
|
|
910
|
+
```
|
|
911
|
+
|
|
912
|
+
### Output Format
|
|
913
|
+
|
|
914
|
+
#### Text Output (Default)
|
|
915
|
+
|
|
916
|
+
rumdl uses a consistent output format for all issues:
|
|
917
|
+
|
|
918
|
+
```text
|
|
919
|
+
{file}:{line}:{column}: [{rule_id}] {message} [{fix_indicator}]
|
|
920
|
+
```
|
|
921
|
+
|
|
922
|
+
The output is colorized by default:
|
|
923
|
+
|
|
924
|
+
- Filenames appear in blue and underlined
|
|
925
|
+
- Line and column numbers appear in cyan
|
|
926
|
+
- Rule IDs appear in yellow
|
|
927
|
+
- Error messages appear in white
|
|
928
|
+
- Fixable issues are marked with `[*]` in green
|
|
929
|
+
- Fixed issues are marked with `[fixed]` in green
|
|
930
|
+
|
|
931
|
+
#### JSON Output
|
|
932
|
+
|
|
933
|
+
For integration with other tools and automation, use `--output json`:
|
|
934
|
+
|
|
935
|
+
```bash
|
|
936
|
+
rumdl check --output json README.md
|
|
937
|
+
```
|
|
938
|
+
|
|
939
|
+
This produces structured JSON output:
|
|
940
|
+
|
|
941
|
+
```json
|
|
942
|
+
{
|
|
943
|
+
"summary": {
|
|
944
|
+
"total_files": 1,
|
|
945
|
+
"files_with_issues": 1,
|
|
946
|
+
"total_issues": 2,
|
|
947
|
+
"fixable_issues": 1
|
|
948
|
+
},
|
|
949
|
+
"files": [
|
|
950
|
+
{
|
|
951
|
+
"path": "README.md",
|
|
952
|
+
"issues": [
|
|
953
|
+
{
|
|
954
|
+
"line": 12,
|
|
955
|
+
"column": 1,
|
|
956
|
+
"rule": "MD022",
|
|
957
|
+
"message": "Headings should be surrounded by blank lines",
|
|
958
|
+
"fixable": true,
|
|
959
|
+
"severity": "error"
|
|
960
|
+
}
|
|
961
|
+
]
|
|
962
|
+
}
|
|
963
|
+
]
|
|
964
|
+
}
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
## Development
|
|
968
|
+
|
|
969
|
+
### Prerequisites
|
|
970
|
+
|
|
971
|
+
- Rust 1.91 or higher
|
|
972
|
+
- Make (for development commands)
|
|
973
|
+
|
|
974
|
+
### Building
|
|
975
|
+
|
|
976
|
+
```bash
|
|
977
|
+
make build
|
|
978
|
+
```
|
|
979
|
+
|
|
980
|
+
### Testing
|
|
981
|
+
|
|
982
|
+
```bash
|
|
983
|
+
make test
|
|
984
|
+
```
|
|
985
|
+
|
|
986
|
+
### JSON Schema Generation
|
|
987
|
+
|
|
988
|
+
If you modify the configuration structures in `src/config.rs`, regenerate the JSON schema:
|
|
989
|
+
|
|
990
|
+
```bash
|
|
991
|
+
# Generate/update the schema
|
|
992
|
+
make schema
|
|
993
|
+
# Or: rumdl schema generate
|
|
994
|
+
|
|
995
|
+
# Check if schema is up-to-date (useful in CI)
|
|
996
|
+
make check-schema
|
|
997
|
+
# Or: rumdl schema check
|
|
998
|
+
|
|
999
|
+
# Print schema to stdout
|
|
1000
|
+
rumdl schema print
|
|
1001
|
+
```
|
|
1002
|
+
|
|
1003
|
+
The schema is automatically generated from the Rust types using `schemars` and should be kept in sync with the configuration structures.
|
|
1004
|
+
|
|
1005
|
+
## License
|
|
1006
|
+
|
|
1007
|
+
rumdl is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
1008
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
rumdl-0.0.184.data/scripts/rumdl,sha256=jcfq6F-80T5-RDWu8RjZ56-vqD8-hRJfed8Hfikr15s,5131312
|
|
2
|
+
rumdl-0.0.184.dist-info/METADATA,sha256=Bu4i-fS-5CKBwifuCiOEN1TeP2bnbrhjO2-qcIKLqOc,31388
|
|
3
|
+
rumdl-0.0.184.dist-info/WHEEL,sha256=K6RyQz3Ufe0lRcsLav96-6nDgK8JHBgxgxxnbBDYnAE,102
|
|
4
|
+
rumdl-0.0.184.dist-info/licenses/LICENSE,sha256=Ux7uE0WuoLktCyy3w5lLIz3_6dc47R0qauPN30mz13M,1079
|
|
5
|
+
rumdl/__init__.py,sha256=Al8fdAo1nixifQiBrXvQtGY-4071FS73uJbLEBAWlYY,267
|
|
6
|
+
rumdl/__main__.py,sha256=6JiDzauqRloCD8LQ_edF-T_RHmoiTWLyMvHjqARL05s,1879
|
|
7
|
+
rumdl/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
rumdl-0.0.184.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2025 Ruben J. Jongejan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|