rumdl 0.0.110__py3-none-musllinux_1_2_aarch64.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.
Potentially problematic release.
This version of rumdl might be problematic. Click here for more details.
- python/rumdl/__init__.py +5 -0
- python/rumdl/__main__.py +57 -0
- python/rumdl/py.typed +1 -0
- rumdl-0.0.110.data/scripts/debug_frontmatter +0 -0
- rumdl-0.0.110.data/scripts/rumdl +0 -0
- rumdl-0.0.110.dist-info/METADATA +712 -0
- rumdl-0.0.110.dist-info/RECORD +9 -0
- rumdl-0.0.110.dist-info/WHEEL +4 -0
- rumdl-0.0.110.dist-info/licenses/LICENSE +21 -0
python/rumdl/__init__.py
ADDED
python/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())
|
python/rumdl/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,712 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rumdl
|
|
3
|
+
Version: 0.0.110
|
|
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)
|
|
38
|
+
[](https://crates.io/crates/rumdl)
|
|
39
|
+
[](https://pypi.org/project/rumdl/)
|
|
40
|
+
[](https://github.com/rvben/rumdl/releases/latest)
|
|
41
|
+
[](https://github.com/rvben/rumdl/stargazers)
|
|
42
|
+
|
|
43
|
+
## A modern Markdown linter and formatter, built for speed with Rust
|
|
44
|
+
|
|
45
|
+
| [**Docs**](https://github.com/rvben/rumdl/blob/main/docs/RULES.md) | [**Rules**](https://github.com/rvben/rumdl/blob/main/docs/RULES.md) | [**Configuration**](#configuration) |
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
## Quick Start
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Install using Cargo
|
|
53
|
+
cargo install rumdl
|
|
54
|
+
|
|
55
|
+
# Lint Markdown files in the current directory
|
|
56
|
+
rumdl check .
|
|
57
|
+
|
|
58
|
+
# Automatically fix issues
|
|
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 fixer that helps ensure consistency and best practices
|
|
68
|
+
in your Markdown files. Inspired by [ruff](https://github.com/astral-sh/ruff)'s approach to Python linting,
|
|
69
|
+
rumdl brings similar speed and developer experience improvements to the Markdown ecosystem.
|
|
70
|
+
|
|
71
|
+
It offers:
|
|
72
|
+
|
|
73
|
+
- ⚡️ **Built for speed** with Rust - significantly faster than alternatives
|
|
74
|
+
- 🔍 **54 lint rules** covering common Markdown issues
|
|
75
|
+
- 🛠️ **Automatic fixing** with `--fix` for most rules
|
|
76
|
+
- 📦 **Zero dependencies** - single binary with no runtime requirements
|
|
77
|
+
- 🔧 **Highly configurable** with TOML-based config files
|
|
78
|
+
- 🌐 **Multiple installation options** - Rust, Python, standalone binaries
|
|
79
|
+
- 🐍 **Installable via pip** for Python users
|
|
80
|
+
- 📏 **Modern CLI** with detailed error reporting
|
|
81
|
+
- 🔄 **CI/CD friendly** with non-zero exit code on errors
|
|
82
|
+
|
|
83
|
+
## Table of Contents
|
|
84
|
+
|
|
85
|
+
- [Quick Start](#quick-start)
|
|
86
|
+
- [Overview](#overview)
|
|
87
|
+
- [Installation](#installation)
|
|
88
|
+
- [Using Homebrew (macOS/Linux)](#using-homebrew-macoslinux)
|
|
89
|
+
- [Using Cargo (Rust)](#using-cargo-rust)
|
|
90
|
+
- [Using pip (Python)](#using-pip-python)
|
|
91
|
+
- [Using uv](#using-uv)
|
|
92
|
+
- [Download binary](#download-binary)
|
|
93
|
+
- [VS Code Extension](#vs-code-extension)
|
|
94
|
+
- [Usage](#usage)
|
|
95
|
+
- [Pre-commit Integration](#pre-commit-integration)
|
|
96
|
+
- [Rules](#rules)
|
|
97
|
+
- [Command-line Interface](#command-line-interface)
|
|
98
|
+
- [Commands](#commands)
|
|
99
|
+
- [Usage Examples](#usage-examples)
|
|
100
|
+
- [Configuration](#configuration)
|
|
101
|
+
- [Configuration File Example](#configuration-file-example)
|
|
102
|
+
- [Initializing Configuration](#initializing-configuration)
|
|
103
|
+
- [Configuration in pyproject.toml](#configuration-in-pyproject-toml)
|
|
104
|
+
- [Configuration Output](#configuration-output)
|
|
105
|
+
- [Effective Configuration (`rumdl config`)](#effective-configuration-rumdl-config)
|
|
106
|
+
- [Example output](#example-output)
|
|
107
|
+
- [Defaults Only (`rumdl config --defaults`)](#defaults-only-rumdl-config-defaults)
|
|
108
|
+
- [Output Style](#output-style)
|
|
109
|
+
- [Output Format](#output-format)
|
|
110
|
+
- [Development](#development)
|
|
111
|
+
- [Prerequisites](#prerequisites)
|
|
112
|
+
- [Building](#building)
|
|
113
|
+
- [Testing](#testing)
|
|
114
|
+
- [License](#license)
|
|
115
|
+
|
|
116
|
+
## Installation
|
|
117
|
+
|
|
118
|
+
Choose the installation method that works best for you:
|
|
119
|
+
|
|
120
|
+
### Using Homebrew (macOS/Linux)
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
brew tap rvben/rumdl
|
|
124
|
+
brew install rumdl
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Using Cargo (Rust)
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
cargo install rumdl
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Using pip (Python)
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
pip install rumdl
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Using uv
|
|
140
|
+
|
|
141
|
+
For faster installation and better dependency management with [uv](https://github.com/astral-sh/uv):
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Install directly
|
|
145
|
+
uv tool install rumdl
|
|
146
|
+
|
|
147
|
+
# Or run without installing
|
|
148
|
+
uv tool run rumdl check .
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Download binary
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Linux/macOS
|
|
155
|
+
curl -LsSf https://github.com/rvben/rumdl/releases/latest/download/rumdl-linux-x86_64.tar.gz | tar xzf - -C /usr/local/bin
|
|
156
|
+
|
|
157
|
+
# Windows PowerShell
|
|
158
|
+
Invoke-WebRequest -Uri "https://github.com/rvben/rumdl/releases/latest/download/rumdl-windows-x86_64.zip" -OutFile "rumdl.zip"
|
|
159
|
+
Expand-Archive -Path "rumdl.zip" -DestinationPath "$env:USERPROFILE\.rumdl"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### VS Code Extension
|
|
163
|
+
|
|
164
|
+
For the best development experience, install the rumdl VS Code extension directly from the command line:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Install the VS Code extension
|
|
168
|
+
rumdl vscode
|
|
169
|
+
|
|
170
|
+
# Check if the extension is installed
|
|
171
|
+
rumdl vscode --status
|
|
172
|
+
|
|
173
|
+
# Force reinstall the extension
|
|
174
|
+
rumdl vscode --force
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The extension provides:
|
|
178
|
+
|
|
179
|
+
- 🔍 Real-time linting as you type
|
|
180
|
+
- 💡 Quick fixes for common issues
|
|
181
|
+
- 🎨 Code formatting on save
|
|
182
|
+
- 📋 Hover tooltips with rule documentation
|
|
183
|
+
- ⚡ Lightning-fast performance with zero lag
|
|
184
|
+
|
|
185
|
+
The CLI will automatically detect VS Code, Cursor, or Windsurf and install the appropriate extension. See the [VS Code extension documentation](https://github.com/rvben/rumdl/blob/main/docs/vscode-extension.md) for more details.
|
|
186
|
+
|
|
187
|
+
## Usage
|
|
188
|
+
|
|
189
|
+
Getting started with rumdl is simple:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
# Lint a single file
|
|
193
|
+
rumdl check README.md
|
|
194
|
+
|
|
195
|
+
# Lint all Markdown files in current directory and subdirectories
|
|
196
|
+
rumdl check .
|
|
197
|
+
|
|
198
|
+
# Automatically fix issues
|
|
199
|
+
rumdl check --fix README.md
|
|
200
|
+
|
|
201
|
+
# Create a default configuration file
|
|
202
|
+
rumdl init
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Common usage examples:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
# Lint with custom configuration
|
|
209
|
+
rumdl check --config my-config.toml docs/
|
|
210
|
+
|
|
211
|
+
# Disable specific rules
|
|
212
|
+
rumdl check --disable MD013,MD033 README.md
|
|
213
|
+
|
|
214
|
+
# Enable only specific rules
|
|
215
|
+
rumdl check --enable MD001,MD003 README.md
|
|
216
|
+
|
|
217
|
+
# Exclude specific files/directories
|
|
218
|
+
rumdl check --exclude "node_modules,dist" .
|
|
219
|
+
|
|
220
|
+
# Include only specific files/directories
|
|
221
|
+
rumdl check --include "docs/*.md,README.md" .
|
|
222
|
+
|
|
223
|
+
# Combine include and exclude patterns
|
|
224
|
+
rumdl check --include "docs/**/*.md" --exclude "docs/temp,docs/drafts" .
|
|
225
|
+
|
|
226
|
+
# Don't respect gitignore files (note: --respect-gitignore defaults to true)
|
|
227
|
+
rumdl check --respect-gitignore=false .
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Pre-commit Integration
|
|
231
|
+
|
|
232
|
+
You can use `rumdl` as a pre-commit hook to check and fix your Markdown files.
|
|
233
|
+
|
|
234
|
+
The recommended way is to use the official pre-commit hook repository:
|
|
235
|
+
|
|
236
|
+
[rumdl-pre-commit repository](https://github.com/rvben/rumdl-pre-commit)
|
|
237
|
+
|
|
238
|
+
Add the following to your `.pre-commit-config.yaml`:
|
|
239
|
+
|
|
240
|
+
```yaml
|
|
241
|
+
repos:
|
|
242
|
+
- repo: https://github.com/rvben/rumdl-pre-commit
|
|
243
|
+
rev: v0.0.99 # Use the latest release tag
|
|
244
|
+
hooks:
|
|
245
|
+
- id: rumdl
|
|
246
|
+
# To only check (default):
|
|
247
|
+
# args: []
|
|
248
|
+
# To automatically fix issues:
|
|
249
|
+
# args: [--fix]
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
- By default, the hook will only check for issues.
|
|
253
|
+
- To automatically fix issues, add `args: [--fix]` to the hook configuration.
|
|
254
|
+
|
|
255
|
+
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.
|
|
256
|
+
|
|
257
|
+
## Rules
|
|
258
|
+
|
|
259
|
+
rumdl implements 54 lint rules for Markdown files. Here are some key rule categories:
|
|
260
|
+
|
|
261
|
+
| Category | Description | Example Rules |
|
|
262
|
+
|-----------|-------------|---------------|
|
|
263
|
+
| **Headings** | Proper heading structure and formatting | MD001, MD002, MD003 |
|
|
264
|
+
| **Lists** | Consistent list formatting and structure | MD004, MD005, MD007 |
|
|
265
|
+
| **Whitespace** | Proper spacing and line length | MD009, MD010, MD012 |
|
|
266
|
+
| **Code** | Code block formatting and language tags | MD040, MD046, MD048 |
|
|
267
|
+
| **Links** | Proper link and reference formatting | MD034, MD039, MD042 |
|
|
268
|
+
| **Images** | Image alt text and references | MD045, MD052 |
|
|
269
|
+
| **Style** | Consistent style across document | MD031, MD032, MD035 |
|
|
270
|
+
|
|
271
|
+
For a complete list of rules and their descriptions, see our [documentation](https://github.com/rvben/rumdl/blob/main/docs/RULES.md) or run:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
rumdl --list-rules
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Command-line Interface
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
rumdl <command> [options] [file or directory...]
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Commands
|
|
284
|
+
|
|
285
|
+
#### `check [PATHS...]`
|
|
286
|
+
|
|
287
|
+
Lint Markdown files and print warnings/errors (main subcommand)
|
|
288
|
+
|
|
289
|
+
**Arguments:**
|
|
290
|
+
|
|
291
|
+
- `[PATHS...]`: Files or directories to lint. If provided, these paths take precedence over include patterns
|
|
292
|
+
|
|
293
|
+
**Options:**
|
|
294
|
+
|
|
295
|
+
- `-f, --fix`: Automatically fix issues where possible
|
|
296
|
+
- `-l, --list-rules`: List all available rules
|
|
297
|
+
- `-d, --disable <rules>`: Disable specific rules (comma-separated)
|
|
298
|
+
- `-e, --enable <rules>`: Enable only specific rules (comma-separated)
|
|
299
|
+
- `--exclude <patterns>`: Exclude specific files or directories (comma-separated glob patterns)
|
|
300
|
+
- `--include <patterns>`: Include only specific files or directories (comma-separated glob patterns)
|
|
301
|
+
- `--respect-gitignore`: Respect .gitignore files when scanning directories (does not apply to explicitly provided paths)
|
|
302
|
+
- `-v, --verbose`: Show detailed output
|
|
303
|
+
- `--profile`: Show profiling information
|
|
304
|
+
- `--statistics`: Show rule violation statistics summary
|
|
305
|
+
- `-q, --quiet`: Quiet mode
|
|
306
|
+
- `-o, --output <format>`: Output format: `text` (default) or `json`
|
|
307
|
+
- `--stdin`: Read from stdin instead of files
|
|
308
|
+
|
|
309
|
+
#### `init [OPTIONS]`
|
|
310
|
+
|
|
311
|
+
Create a default configuration file in the current directory
|
|
312
|
+
|
|
313
|
+
**Options:**
|
|
314
|
+
|
|
315
|
+
- `--pyproject`: Generate configuration for `pyproject.toml` instead of `.rumdl.toml`
|
|
316
|
+
|
|
317
|
+
#### `import <FILE> [OPTIONS]`
|
|
318
|
+
|
|
319
|
+
Import and convert markdownlint configuration files to rumdl format
|
|
320
|
+
|
|
321
|
+
**Arguments:**
|
|
322
|
+
|
|
323
|
+
- `<FILE>`: Path to markdownlint config file (JSON/YAML)
|
|
324
|
+
|
|
325
|
+
**Options:**
|
|
326
|
+
|
|
327
|
+
- `-o, --output <path>`: Output file path (default: `.rumdl.toml`)
|
|
328
|
+
- `--format <format>`: Output format: `toml` or `json` (default: `toml`)
|
|
329
|
+
- `--dry-run`: Show converted config without writing to file
|
|
330
|
+
|
|
331
|
+
#### `rule [<rule>]`
|
|
332
|
+
|
|
333
|
+
Show information about a rule or list all rules
|
|
334
|
+
|
|
335
|
+
**Arguments:**
|
|
336
|
+
|
|
337
|
+
- `[rule]`: Rule name or ID (optional). If provided, shows details for that rule. If omitted, lists all available rules
|
|
338
|
+
|
|
339
|
+
#### `config [OPTIONS] [COMMAND]`
|
|
340
|
+
|
|
341
|
+
Show configuration or query a specific key
|
|
342
|
+
|
|
343
|
+
**Options:**
|
|
344
|
+
|
|
345
|
+
- `--defaults`: Show only the default configuration values
|
|
346
|
+
- `--output <format>`: Output format (e.g. `toml`, `json`)
|
|
347
|
+
|
|
348
|
+
**Subcommands:**
|
|
349
|
+
|
|
350
|
+
- `get <key>`: Query a specific config key (e.g. `global.exclude` or `MD013.line_length`)
|
|
351
|
+
- `file`: Show the absolute path of the configuration file that was loaded
|
|
352
|
+
|
|
353
|
+
#### `server [OPTIONS]`
|
|
354
|
+
|
|
355
|
+
Start the Language Server Protocol server for editor integration
|
|
356
|
+
|
|
357
|
+
**Options:**
|
|
358
|
+
|
|
359
|
+
- `--port <PORT>`: TCP port to listen on (for debugging)
|
|
360
|
+
- `--stdio`: Use stdio for communication (default)
|
|
361
|
+
- `-v, --verbose`: Enable verbose logging
|
|
362
|
+
|
|
363
|
+
#### `vscode [OPTIONS]`
|
|
364
|
+
|
|
365
|
+
Install the rumdl VS Code extension
|
|
366
|
+
|
|
367
|
+
**Options:**
|
|
368
|
+
|
|
369
|
+
- `--force`: Force reinstall even if already installed
|
|
370
|
+
- `--status`: Show installation status without installing
|
|
371
|
+
|
|
372
|
+
#### `version`
|
|
373
|
+
|
|
374
|
+
Show version information
|
|
375
|
+
|
|
376
|
+
### Global Options
|
|
377
|
+
|
|
378
|
+
These options are available for all commands:
|
|
379
|
+
|
|
380
|
+
- `--color <mode>`: Control colored output: `auto` (default), `always`, `never`
|
|
381
|
+
- `--config <file>`: Path to configuration file
|
|
382
|
+
- `--no-config`: Ignore all configuration files and use built-in defaults
|
|
383
|
+
|
|
384
|
+
### Exit Codes
|
|
385
|
+
|
|
386
|
+
rumdl uses exit codes following Ruff's convention for easy CI/CD integration:
|
|
387
|
+
|
|
388
|
+
- `0`: Success - no issues found
|
|
389
|
+
- `1`: Linting violations found
|
|
390
|
+
- `2`: Tool error (configuration error, file access error, invalid arguments, etc.)
|
|
391
|
+
|
|
392
|
+
This allows scripts and CI/CD systems to distinguish between "the tool found problems in your files" (exit 1) and "the tool couldn't run properly" (exit 2).
|
|
393
|
+
|
|
394
|
+
### Usage Examples
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
# Lint all Markdown files in the current directory
|
|
398
|
+
rumdl check .
|
|
399
|
+
|
|
400
|
+
# Automatically fix issues
|
|
401
|
+
rumdl check --fix .
|
|
402
|
+
|
|
403
|
+
# Create a default configuration file
|
|
404
|
+
rumdl init
|
|
405
|
+
|
|
406
|
+
# Create or update a pyproject.toml file with rumdl configuration
|
|
407
|
+
rumdl init --pyproject
|
|
408
|
+
|
|
409
|
+
# Import a markdownlint config file
|
|
410
|
+
rumdl import .markdownlint.json
|
|
411
|
+
|
|
412
|
+
# Convert markdownlint config to JSON format
|
|
413
|
+
rumdl import --format json .markdownlint.yaml --output rumdl-config.json
|
|
414
|
+
|
|
415
|
+
# Preview conversion without writing file
|
|
416
|
+
rumdl import --dry-run .markdownlint.json
|
|
417
|
+
|
|
418
|
+
# Show information about a specific rule
|
|
419
|
+
rumdl rule MD013
|
|
420
|
+
|
|
421
|
+
# List all available rules
|
|
422
|
+
rumdl rule
|
|
423
|
+
|
|
424
|
+
# Query a specific config key
|
|
425
|
+
rumdl config get global.exclude
|
|
426
|
+
|
|
427
|
+
# Show the path of the loaded configuration file
|
|
428
|
+
rumdl config file
|
|
429
|
+
|
|
430
|
+
# Show configuration as JSON instead of the default format
|
|
431
|
+
rumdl config --output json
|
|
432
|
+
|
|
433
|
+
# Lint content from stdin
|
|
434
|
+
echo "# My Heading" | rumdl check --stdin
|
|
435
|
+
|
|
436
|
+
# Get JSON output for integration with other tools
|
|
437
|
+
rumdl check --output json README.md
|
|
438
|
+
|
|
439
|
+
# Show statistics summary of rule violations
|
|
440
|
+
rumdl check --statistics .
|
|
441
|
+
|
|
442
|
+
# Disable colors in output
|
|
443
|
+
rumdl check --color never README.md
|
|
444
|
+
|
|
445
|
+
# Use built-in defaults, ignoring all config files
|
|
446
|
+
rumdl check --no-config README.md
|
|
447
|
+
|
|
448
|
+
# Show version information
|
|
449
|
+
rumdl version
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
## Configuration
|
|
453
|
+
|
|
454
|
+
rumdl can be configured in several ways:
|
|
455
|
+
|
|
456
|
+
1. Using a `.rumdl.toml` file in your project directory
|
|
457
|
+
2. Using the `[tool.rumdl]` section in your project's `pyproject.toml` file (for Python projects)
|
|
458
|
+
3. Using command-line arguments
|
|
459
|
+
4. **Automatic markdownlint compatibility**: rumdl automatically discovers and loads existing markdownlint config files (`.markdownlint.json`, `.markdownlint.yaml`, etc.)
|
|
460
|
+
|
|
461
|
+
### Markdownlint Migration
|
|
462
|
+
|
|
463
|
+
rumdl provides seamless compatibility with existing markdownlint configurations:
|
|
464
|
+
|
|
465
|
+
**Automatic Discovery**: rumdl automatically detects and loads markdownlint config files:
|
|
466
|
+
|
|
467
|
+
- `.markdownlint.json` / `.markdownlint.jsonc`
|
|
468
|
+
- `.markdownlint.yaml` / `.markdownlint.yml`
|
|
469
|
+
- `markdownlint.json` / `markdownlint.yaml`
|
|
470
|
+
|
|
471
|
+
**Explicit Import**: Convert markdownlint configs to rumdl format:
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
# Convert to .rumdl.toml
|
|
475
|
+
rumdl import .markdownlint.json
|
|
476
|
+
|
|
477
|
+
# Convert to JSON format
|
|
478
|
+
rumdl import --format json .markdownlint.yaml --output config.json
|
|
479
|
+
|
|
480
|
+
# Preview conversion
|
|
481
|
+
rumdl import --dry-run .markdownlint.json
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
For comprehensive documentation on global settings (file selection, rule enablement, etc.), see our [Global Settings Reference](docs/global-settings.md).
|
|
485
|
+
|
|
486
|
+
### Configuration File Example
|
|
487
|
+
|
|
488
|
+
Here's an example `.rumdl.toml` configuration file:
|
|
489
|
+
|
|
490
|
+
```toml
|
|
491
|
+
# Global settings
|
|
492
|
+
line-length = 100
|
|
493
|
+
exclude = ["node_modules", "build", "dist"]
|
|
494
|
+
respect-gitignore = true
|
|
495
|
+
|
|
496
|
+
# Disable specific rules
|
|
497
|
+
disabled-rules = ["MD013", "MD033"]
|
|
498
|
+
|
|
499
|
+
# Configure individual rules
|
|
500
|
+
[MD007]
|
|
501
|
+
indent = 2
|
|
502
|
+
|
|
503
|
+
[MD013]
|
|
504
|
+
line-length = 100
|
|
505
|
+
code-blocks = false
|
|
506
|
+
tables = false
|
|
507
|
+
|
|
508
|
+
[MD025]
|
|
509
|
+
level = 1
|
|
510
|
+
front-matter-title = "title"
|
|
511
|
+
|
|
512
|
+
[MD044]
|
|
513
|
+
names = ["rumdl", "Markdown", "GitHub"]
|
|
514
|
+
|
|
515
|
+
[MD048]
|
|
516
|
+
code-fence-style = "backtick"
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
### Initializing Configuration
|
|
520
|
+
|
|
521
|
+
To create a configuration file, use the `init` command:
|
|
522
|
+
|
|
523
|
+
```bash
|
|
524
|
+
# Create a .rumdl.toml file (for any project)
|
|
525
|
+
rumdl init
|
|
526
|
+
|
|
527
|
+
# Create or update a pyproject.toml file with rumdl configuration (for Python projects)
|
|
528
|
+
rumdl init --pyproject
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
### Configuration in pyproject.toml
|
|
532
|
+
|
|
533
|
+
For Python projects, you can include rumdl configuration in your `pyproject.toml` file, keeping all project configuration in one place. Example:
|
|
534
|
+
|
|
535
|
+
```toml
|
|
536
|
+
[tool.rumdl]
|
|
537
|
+
# Global options at root level
|
|
538
|
+
line-length = 100
|
|
539
|
+
disable = ["MD033"]
|
|
540
|
+
include = ["docs/*.md", "README.md"]
|
|
541
|
+
exclude = [".git", "node_modules"]
|
|
542
|
+
ignore-gitignore = false
|
|
543
|
+
|
|
544
|
+
# Rule-specific configuration
|
|
545
|
+
[tool.rumdl.MD013]
|
|
546
|
+
code_blocks = false
|
|
547
|
+
tables = false
|
|
548
|
+
|
|
549
|
+
[tool.rumdl.MD044]
|
|
550
|
+
names = ["rumdl", "Markdown", "GitHub"]
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
Both kebab-case (`line-length`, `ignore-gitignore`) and snake_case (`line_length`, `ignore_gitignore`) formats are supported for compatibility with different Python tooling conventions.
|
|
554
|
+
|
|
555
|
+
### Configuration Output
|
|
556
|
+
|
|
557
|
+
#### Effective Configuration (`rumdl config`)
|
|
558
|
+
|
|
559
|
+
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.
|
|
560
|
+
The output is colorized and the `[from ...]` annotation is globally aligned for easy scanning.
|
|
561
|
+
|
|
562
|
+
#### Example output
|
|
563
|
+
|
|
564
|
+
```text
|
|
565
|
+
[global]
|
|
566
|
+
enable = [] [from default]
|
|
567
|
+
disable = ["MD033"] [from .rumdl.toml]
|
|
568
|
+
include = ["README.md"] [from .rumdl.toml]
|
|
569
|
+
respect_gitignore = true [from .rumdl.toml]
|
|
570
|
+
|
|
571
|
+
[MD013]
|
|
572
|
+
line_length = 200 [from .rumdl.toml]
|
|
573
|
+
code_blocks = true [from .rumdl.toml]
|
|
574
|
+
...
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
- **Keys** are cyan, **values** are yellow, and the `[from ...]` annotation is colored by source:
|
|
578
|
+
- Green: CLI
|
|
579
|
+
- Blue: `.rumdl.toml`
|
|
580
|
+
- Magenta: `pyproject.toml`
|
|
581
|
+
- Yellow: default
|
|
582
|
+
- The `[from ...]` column is aligned across all sections.
|
|
583
|
+
|
|
584
|
+
### Defaults Only (`rumdl config --defaults`)
|
|
585
|
+
|
|
586
|
+
The `--defaults` flag prints only the default configuration as TOML, suitable for copy-paste or reference:
|
|
587
|
+
|
|
588
|
+
```toml
|
|
589
|
+
[global]
|
|
590
|
+
enable = []
|
|
591
|
+
disable = []
|
|
592
|
+
exclude = []
|
|
593
|
+
include = []
|
|
594
|
+
respect_gitignore = true
|
|
595
|
+
|
|
596
|
+
[MD013]
|
|
597
|
+
line_length = 80
|
|
598
|
+
code_blocks = true
|
|
599
|
+
...
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
## Output Style
|
|
603
|
+
|
|
604
|
+
rumdl produces clean, colorized output similar to modern linting tools:
|
|
605
|
+
|
|
606
|
+
```text
|
|
607
|
+
README.md:12:1: [MD022] Headings should be surrounded by blank lines [*]
|
|
608
|
+
README.md:24:5: [MD037] Spaces inside emphasis markers: "* incorrect *" [*]
|
|
609
|
+
README.md:31:76: [MD013] Line length exceeds 80 characters
|
|
610
|
+
README.md:42:3: [MD010] Hard tabs found, use spaces instead [*]
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
When running with `--fix`, rumdl shows which issues were fixed:
|
|
614
|
+
|
|
615
|
+
```text
|
|
616
|
+
README.md:12:1: [MD022] Headings should be surrounded by blank lines [fixed]
|
|
617
|
+
README.md:24:5: [MD037] Spaces inside emphasis markers: "* incorrect *" [fixed]
|
|
618
|
+
README.md:42:3: [MD010] Hard tabs found, use spaces instead [fixed]
|
|
619
|
+
|
|
620
|
+
Fixed 3 issues in 1 file
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
For a more detailed view, use the `--verbose` option:
|
|
624
|
+
|
|
625
|
+
```text
|
|
626
|
+
✓ No issues found in CONTRIBUTING.md
|
|
627
|
+
README.md:12:1: [MD022] Headings should be surrounded by blank lines [*]
|
|
628
|
+
README.md:24:5: [MD037] Spaces inside emphasis markers: "* incorrect *" [*]
|
|
629
|
+
README.md:42:3: [MD010] Hard tabs found, use spaces instead [*]
|
|
630
|
+
|
|
631
|
+
Found 3 issues in 1 file (2 files checked)
|
|
632
|
+
Run with `--fix` to automatically fix issues
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
### Output Format
|
|
636
|
+
|
|
637
|
+
#### Text Output (Default)
|
|
638
|
+
|
|
639
|
+
rumdl uses a consistent output format for all issues:
|
|
640
|
+
|
|
641
|
+
```text
|
|
642
|
+
{file}:{line}:{column}: [{rule_id}] {message} [{fix_indicator}]
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
The output is colorized by default:
|
|
646
|
+
|
|
647
|
+
- Filenames appear in blue and underlined
|
|
648
|
+
- Line and column numbers appear in cyan
|
|
649
|
+
- Rule IDs appear in yellow
|
|
650
|
+
- Error messages appear in white
|
|
651
|
+
- Fixable issues are marked with `[*]` in green
|
|
652
|
+
- Fixed issues are marked with `[fixed]` in green
|
|
653
|
+
|
|
654
|
+
#### JSON Output
|
|
655
|
+
|
|
656
|
+
For integration with other tools and automation, use `--output json`:
|
|
657
|
+
|
|
658
|
+
```bash
|
|
659
|
+
rumdl check --output json README.md
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
This produces structured JSON output:
|
|
663
|
+
|
|
664
|
+
```json
|
|
665
|
+
{
|
|
666
|
+
"summary": {
|
|
667
|
+
"total_files": 1,
|
|
668
|
+
"files_with_issues": 1,
|
|
669
|
+
"total_issues": 2,
|
|
670
|
+
"fixable_issues": 1
|
|
671
|
+
},
|
|
672
|
+
"files": [
|
|
673
|
+
{
|
|
674
|
+
"path": "README.md",
|
|
675
|
+
"issues": [
|
|
676
|
+
{
|
|
677
|
+
"line": 12,
|
|
678
|
+
"column": 1,
|
|
679
|
+
"rule": "MD022",
|
|
680
|
+
"message": "Headings should be surrounded by blank lines",
|
|
681
|
+
"fixable": true,
|
|
682
|
+
"severity": "error"
|
|
683
|
+
}
|
|
684
|
+
]
|
|
685
|
+
}
|
|
686
|
+
]
|
|
687
|
+
}
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
## Development
|
|
691
|
+
|
|
692
|
+
### Prerequisites
|
|
693
|
+
|
|
694
|
+
- Rust 1.70 or higher
|
|
695
|
+
- Make (for development commands)
|
|
696
|
+
|
|
697
|
+
### Building
|
|
698
|
+
|
|
699
|
+
```bash
|
|
700
|
+
make build
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
### Testing
|
|
704
|
+
|
|
705
|
+
```bash
|
|
706
|
+
make test
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
## License
|
|
710
|
+
|
|
711
|
+
rumdl is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
712
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
python/rumdl/__init__.py,sha256=En6tBgSj-MMeUcBAV7HlMjfstzY6npWxZtsRa30hIj0,90
|
|
2
|
+
python/rumdl/__main__.py,sha256=DQ-es4rlJ-iiHUeoTruvZzp-YV6rGShOWZYN4zBx_Iw,1903
|
|
3
|
+
python/rumdl/py.typed,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
|
4
|
+
rumdl-0.0.110.data/scripts/debug_frontmatter,sha256=n2q4Fj8bseJV50lsTQVeh6avdL_68avtX_To5TfVcx4,1354360
|
|
5
|
+
rumdl-0.0.110.data/scripts/rumdl,sha256=yT_7Oet_xqB7dLlgcyyRF-wbMHbEvvNauFY-qLDrMNk,5009736
|
|
6
|
+
rumdl-0.0.110.dist-info/METADATA,sha256=vy6c6IRjWdTTmYJHnCUBFhdMLcrgL6ks1zKWTbvtNWk,20463
|
|
7
|
+
rumdl-0.0.110.dist-info/WHEEL,sha256=dmjHqLt-6cCjWB3RgXfSpOK9krDDmUwuIXM1nm6pAe4,105
|
|
8
|
+
rumdl-0.0.110.dist-info/licenses/LICENSE,sha256=-DMWkbVE5Jg4GtaZNa3as6TKHpxbalXjYV96RLRuH-E,1078
|
|
9
|
+
rumdl-0.0.110.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.
|