rumdl 0.0.16__py3-none-win_amd64.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.
@@ -0,0 +1,5 @@
1
+ """
2
+ rumdl: An extremely fast Markdown linter written in Rust.
3
+ """
4
+
5
+ __version__ = "0.0.12"
@@ -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
@@ -0,0 +1,310 @@
1
+ Metadata-Version: 2.4
2
+ Name: rumdl
3
+ Version: 0.0.16
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
+ Summary: An extremely fast Markdown linter written in Rust
21
+ Keywords: markdown,linter,markdown-linter,static-analysis,documentation
22
+ Home-Page: https://github.com/rvben/rumdl
23
+ Author: Ruben J. Jongejan <ruben.jongejan@gmail.com>
24
+ Author-email: "Ruben J. Jongejan" <ruben.jongejan@gmail.com>
25
+ License: MIT
26
+ Requires-Python: >=3.7
27
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
28
+ Project-URL: Homepage, https://github.com/rvben/rumdl
29
+ Project-URL: Repository, https://github.com/rvben/rumdl.git
30
+
31
+ # rumdl - An extremely fast Markdown linter, written in Rust
32
+
33
+ <div align="center">
34
+
35
+ ![rumdl Logo](https://raw.githubusercontent.com/user/rumdl/main/assets/logo.png)
36
+
37
+ [![Build Status](https://img.shields.io/github/workflow/status/user/rumdl/CI)](https://github.com/user/rumdl/actions)
38
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
39
+ [![Crates.io](https://img.shields.io/crates/v/rumdl)](https://crates.io/crates/rumdl)
40
+ [![PyPI](https://img.shields.io/pypi/v/rumdl)](https://pypi.org/project/rumdl/)
41
+
42
+ **An extremely fast Markdown linter and formatter, written in Rust.**
43
+
44
+ [**Docs**](docs/RULES.md) | [**Rules**](docs/RULES.md) | [**Configuration**](#configuration)
45
+
46
+ </div>
47
+
48
+ ## Table of Contents
49
+
50
+ - [rumdl - An extremely fast Markdown linter, written in Rust](#rumdl---an-extremely-fast-markdown-linter-written-in-rust)
51
+ - [Table of Contents](#table-of-contents)
52
+ - [Overview](#overview)
53
+ - [Installation](#installation)
54
+ - [Using Cargo (Rust)](#using-cargo-rust)
55
+ - [Using pip (Python)](#using-pip-python)
56
+ - [Download binary](#download-binary)
57
+ - [Usage](#usage)
58
+ - [Rules](#rules)
59
+ - [Command-line Interface](#command-line-interface)
60
+ - [Commands](#commands)
61
+ - [Options](#options)
62
+ - [Configuration](#configuration)
63
+ - [Output Style](#output-style)
64
+ - [Output Format](#output-format)
65
+ - [Development](#development)
66
+ - [Prerequisites](#prerequisites)
67
+ - [Building](#building)
68
+ - [Testing](#testing)
69
+ - [License](#license)
70
+
71
+ ## Overview
72
+
73
+ rumdl is a lightning-fast Markdown linter and fixer that helps ensure consistency and best practices in your Markdown files. It offers:
74
+
75
+ - ⚡️ **10-50x faster** than other Markdown linters
76
+ - 🔍 **50+ lint rules** covering common Markdown issues
77
+ - 🛠️ **Automatic fixing** with `--fix` for most rules
78
+ - 📦 **Zero dependencies** - single binary with no runtime requirements
79
+ - 🔧 **Highly configurable** with TOML-based config files
80
+ - 🌐 **Multiple installation options** - Rust, Python, standalone binaries
81
+ - 📏 **Modern CLI** with detailed error reporting
82
+ - 🔄 **CI/CD friendly** with non-zero exit code on errors
83
+
84
+ ## Installation
85
+
86
+ Choose the installation method that works best for you:
87
+
88
+ ### Using Cargo (Rust)
89
+
90
+ ```bash
91
+ cargo install rumdl
92
+ ```
93
+
94
+ ### Using pip (Python)
95
+
96
+ ```bash
97
+ pip install rumdl
98
+ ```
99
+
100
+ ### Download binary
101
+
102
+ ```bash
103
+ # Linux/macOS
104
+ curl -LsSf https://github.com/user/rumdl/releases/latest/download/rumdl-linux-x86_64.tar.gz | tar xzf - -C /usr/local/bin
105
+
106
+ # Windows PowerShell
107
+ Invoke-WebRequest -Uri "https://github.com/user/rumdl/releases/latest/download/rumdl-windows-x86_64.zip" -OutFile "rumdl.zip"
108
+ Expand-Archive -Path "rumdl.zip" -DestinationPath "$env:USERPROFILE\.rumdl"
109
+ ```
110
+
111
+ ## Usage
112
+
113
+ Getting started with rumdl is simple:
114
+
115
+ ```bash
116
+ # Check a single file
117
+ rumdl README.md
118
+
119
+ # Check all Markdown files in current directory and subdirectories
120
+ rumdl .
121
+
122
+ # Automatically fix issues
123
+ rumdl --fix README.md
124
+
125
+ # Create a default configuration file
126
+ rumdl init
127
+ ```
128
+
129
+ Common usage examples:
130
+
131
+ ```bash
132
+ # Check with custom configuration
133
+ rumdl --config my-config.toml docs/
134
+
135
+ # Disable specific rules
136
+ rumdl --disable MD013,MD033 README.md
137
+
138
+ # Enable only specific rules
139
+ rumdl --enable MD001,MD003 README.md
140
+
141
+ # Exclude specific files/directories
142
+ rumdl --exclude "node_modules,dist" .
143
+ ```
144
+
145
+ ## Rules
146
+
147
+ rumdl implements over 50 lint rules for Markdown files. Here are some key rule categories:
148
+
149
+ | Category | Description | Example Rules |
150
+ |----------|-------------|--------------|
151
+ | **Headings** | Proper heading structure and formatting | MD001, MD002, MD003 |
152
+ | **Lists** | Consistent list formatting and structure | MD004, MD005, MD007 |
153
+ | **Whitespace** | Proper spacing and line length | MD009, MD010, MD012 |
154
+ | **Code** | Code block formatting and language tags | MD040, MD046, MD048 |
155
+ | **Links** | Proper link and reference formatting | MD034, MD039, MD042 |
156
+ | **Images** | Image alt text and references | MD045, MD052 |
157
+ | **Style** | Consistent style across document | MD031, MD032, MD035 |
158
+
159
+ For a complete list of rules and their descriptions, see our [documentation](docs/RULES.md) or run:
160
+
161
+ ```bash
162
+ rumdl --list-rules
163
+ ```
164
+
165
+ ## Command-line Interface
166
+
167
+ ```bash
168
+ rumdl [options] [file or directory...]
169
+ rumdl <command> [options]
170
+ ```
171
+
172
+ ### Commands
173
+
174
+ - `init`: Create a default `.rumdl.toml` configuration file in the current directory
175
+
176
+ ### Options
177
+
178
+ - `-c, --config <file>`: Use custom configuration file
179
+ - `-f, --fix`: Automatically fix issues where possible
180
+ - `-l, --list-rules`: List all available rules
181
+ - `-d, --disable <rules>`: Disable specific rules (comma-separated)
182
+ - `-e, --enable <rules>`: Enable only specific rules (comma-separated)
183
+ - `--exclude <patterns>`: Exclude specific files or directories (comma-separated glob patterns)
184
+ - `--respect-gitignore`: Respect .gitignore files when scanning directories
185
+ - `-v, --verbose`: Show detailed output
186
+
187
+ ## Configuration
188
+
189
+ rumdl can be configured using a TOML configuration file. By default, it looks for `rumdl.toml` or `.rumdl.toml` in the current directory.
190
+
191
+ You can create a default configuration file using the `init` command:
192
+
193
+ ```bash
194
+ rumdl init
195
+ ```
196
+
197
+ This will create a `.rumdl.toml` file in the current directory with default settings that you can customize.
198
+
199
+ Example configuration file:
200
+
201
+ ```toml
202
+ # Global configuration options
203
+ [global]
204
+ # List of rules to disable
205
+ disable = ["MD013", "MD033"]
206
+
207
+ # List of rules to enable exclusively (if provided, only these rules will run)
208
+ # enable = ["MD001", "MD003", "MD004"]
209
+
210
+ # List of file/directory patterns to exclude from linting
211
+ exclude = [
212
+ # Common directories to exclude
213
+ ".git",
214
+ ".github",
215
+ "node_modules",
216
+ "vendor",
217
+ "dist",
218
+ "build",
219
+
220
+ # Specific files or patterns
221
+ "CHANGELOG.md",
222
+ "LICENSE.md",
223
+ "generated/*.md",
224
+ "**/temp_*.md",
225
+ ]
226
+
227
+ # Whether to respect .gitignore files when scanning directories
228
+ respect_gitignore = false
229
+
230
+ # Rule-specific configurations
231
+ [MD002]
232
+ level = 1 # Expected level for first heading
233
+
234
+ [MD003]
235
+ style = "atx" # Heading style (atx, atx_closed, setext)
236
+ ```
237
+
238
+ ## Output Style
239
+
240
+ rumdl produces clean, colorized output similar to modern linting tools:
241
+
242
+ ```text
243
+ README.md:12:1: [MD022] Headings should be surrounded by blank lines [*]
244
+ README.md:24:5: [MD037] Spaces inside emphasis markers: "* incorrect *" [*]
245
+ README.md:31:76: [MD013] Line length exceeds 80 characters
246
+ README.md:42:3: [MD010] Hard tabs found, use spaces instead [*]
247
+ ```
248
+
249
+ When running with `--fix`, rumdl shows which issues were fixed:
250
+
251
+ ```text
252
+ README.md:12:1: [MD022] Headings should be surrounded by blank lines [fixed]
253
+ README.md:24:5: [MD037] Spaces inside emphasis markers: "* incorrect *" [fixed]
254
+ README.md:42:3: [MD010] Hard tabs found, use spaces instead [fixed]
255
+
256
+ Fixed 3 issues in 1 file
257
+ ```
258
+
259
+ For a more detailed view, use the `--verbose` option:
260
+
261
+ ```text
262
+ ✓ No issues found in CONTRIBUTING.md
263
+ README.md:12:1: [MD022] Headings should be surrounded by blank lines [*]
264
+ README.md:24:5: [MD037] Spaces inside emphasis markers: "* incorrect *" [*]
265
+ README.md:42:3: [MD010] Hard tabs found, use spaces instead [*]
266
+
267
+ Found 3 issues in 1 file (2 files checked)
268
+ Run with `--fix` to automatically fix issues
269
+ ```
270
+
271
+ ### Output Format
272
+
273
+ rumdl uses a consistent output format for all issues:
274
+
275
+ ```text
276
+ {file}:{line}:{column}: [{rule*id}] {message} [{fix*indicator}]
277
+ ```
278
+
279
+ The output is colorized by default:
280
+
281
+ - Filenames appear in blue and underlined
282
+ - Line and column numbers appear in cyan
283
+ - Rule IDs appear in yellow
284
+ - Error messages appear in white
285
+ - Fixable issues are marked with `[*]` in green
286
+ - Fixed issues are marked with `[fixed]` in green
287
+
288
+ ## Development
289
+
290
+ ### Prerequisites
291
+
292
+ - Rust 1.70 or higher
293
+ - Make (for development commands)
294
+
295
+ ### Building
296
+
297
+ ```bash
298
+ make build
299
+ ```
300
+
301
+ ### Testing
302
+
303
+ ```bash
304
+ make test
305
+ ```
306
+
307
+ ## License
308
+
309
+ MIT License
310
+
@@ -0,0 +1,7 @@
1
+ rumdl-0.0.16.dist-info/METADATA,sha256=9B8quvI6svfhWM4P3kb6JlXQrTbPXdMFhu44LS2fGrA,9453
2
+ rumdl-0.0.16.dist-info/WHEEL,sha256=LLQFiH3PDiV0Fx2rdtwgTAjjdTZOsQg2uytkqCh5Fbg,93
3
+ python/rumdl/py.typed,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
4
+ python/rumdl/__init__.py,sha256=oHcESVopbLsh5hnNa4Z1iLIS-Bi9ai_Bzc5mLuibiUY,95
5
+ python/rumdl/__main__.py,sha256=xlCbPU2Q4ZrlTc3Aeg0d0EFxqfA4QILeVnKckqeMqDQ,1959
6
+ rumdl-0.0.16.data/scripts/rumdl.exe,sha256=ef1vkB_furUezOix0FKYw95CkzNf7-fJhFxCKlLEu18,4507648
7
+ rumdl-0.0.16.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.8.3)
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64