mdformat-ruff
Mdformat plugin to ruffen Python code blocks
Description
mdformat-ruff is an mdformat plugin that makes mdformat format Python code blocks with ruff.
Usage
Install with:
pip install mdformat-ruff
You may pin ruff dependency for formatting stability:
pip install mdformat-ruff ruff==22.1.0
When using mdformat on the command line, ruff formatting will be automatically enabled after install.
When using mdformat Python API, code formatting for Python will have to be enabled explicitly:
import mdformat
unformatted = "```python\n'''ruff converts quotes'''\n```\n"
formatted = mdformat.text(unformatted, codeformatters={"python"})
assert formatted == '```python\n"""ruff converts quotes"""\n```\n'
Usage as a pre-commit hook
Add the following to your .pre-commit-config.yaml:
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.13 # Use the ref you want to point at
hooks:
- id: mdformat
additional_dependencies:
- mdformat-ruff
- ruff==22.1.0 # Pinning ruff here is optional
Metadata
Release files for mdformat-ruff 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mdformat_ruff-0.1.3.tar.gz | 3.4 kB | Without provenance | Details for mdformat_ruff-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mdformat_ruff-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for mdformat_ruff-0.1.3-py3-none-any.whl |
Total release size: 7.3 kB
Release files / mdformat_ruff-0.1.3.tar.gz
| Download URL | mdformat_ruff-0.1.3.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ddd2758dd3f6738c1c7bfbeb89320d271454f4cd8c28a99968a50d3578b15d6
|
|
BLAKE2b-256 checksum How to use checksums |
3ae29003dc57c78aea34b21f67854d842985ceac48028d288432efa113df3887
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Release files / mdformat_ruff-0.1.3-py3-none-any.whl
| Download URL | mdformat_ruff-0.1.3-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c0cf7bfe6bf99b9e0e617e960041d06e9fa84300d5645f922306dd2ed0d1296
|
|
BLAKE2b-256 checksum How to use checksums |
b1223f2464d478f145bbcb731cee9fe720b9e4d69efb6ffd8bc4491f14ca20a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Security for mdformat-ruff 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.