https://github.com/reflex-dev/ruff-format
https://github.com/reflex-dev/ruff-format
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/reflex-dev/ruff-format
- Owner: reflex-dev
- License: mit
- Created: 2025-10-09T20:39:27.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-10-28T18:24:31.000Z (3 months ago)
- Last Synced: 2025-12-01T17:48:20.979Z (about 2 months ago)
- Language: Rust
- Size: 21.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ruff-format
A fast Python code formatter powered by [Ruff](https://github.com/astral-sh/ruff)'s formatting engine.
## Overview
`ruff-format` is a Python package that provides Python bindings to Ruff's Python formatter.
## Installation
```bash
pip install ruff-format
```
## Usage
```python
from ruff_format import format_string, is_valid_syntax
code = """
def hello( x,y, z ):
print( x+y+z )
"""
assert is_valid_syntax(code)
formatted = format_string(code)
print(formatted)
```
## Development
### Prerequisites
- Rust (latest stable)
- Python 3.8+
- [maturin](https://github.com/PyO3/maturin)
### Building from source
```bash
# Install maturin
pip install maturin
# Build the package
maturin develop
# Or build a release version
maturin build --release
```
## License
MIT
## Links
- [Repository](https://github.com/reflex-dev/ruff-format)
- [Ruff](https://github.com/astral-sh/ruff)