File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ # ruff-format
2+
3+ A fast Python code formatter powered by [ Ruff] ( https://github.com/astral-sh/ruff ) 's formatting engine.
4+
5+ ## Overview
6+
7+ ` ruff-format ` is a Python package that provides Python bindings to Ruff's Python formatter.
8+
9+ ## Installation
10+
11+ ``` bash
12+ pip install ruff-format
13+ ```
14+
15+ ## Usage
16+
17+ ``` python
18+ from ruff_format import format_string
19+
20+ code = """
21+ def hello( x,y, z ):
22+ print( x+y+z )
23+ """
24+
25+ formatted = format_string(code)
26+ print (formatted)
27+ ```
28+
29+ ## Development
30+
31+ ### Prerequisites
32+
33+ - Rust (latest stable)
34+ - Python 3.8+
35+ - [ maturin] ( https://github.com/PyO3/maturin )
36+
37+ ### Building from source
38+
39+ ``` bash
40+ # Install maturin
41+ pip install maturin
42+
43+ # Build the package
44+ maturin develop
45+
46+ # Or build a release version
47+ maturin build --release
48+ ```
49+
50+ ## License
51+
52+ MIT
53+
54+ ## Links
55+
56+ - [ Repository] ( https://github.com/reflex-dev/ruff-format )
57+ - [ Ruff] ( https://github.com/astral-sh/ruff )
You can’t perform that action at this time.
0 commit comments