Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 1.05 KB

README.md

File metadata and controls

41 lines (27 loc) · 1.05 KB

Melpa Status

ruff-format.el

This Emacs library provides commands and a minor mode for easily reformatting Python source code using Ruff.

Installation

If you choose not to use one of the convenient packages in MELPA, you'll need to add the directory containing ruff-format.el to your load-path, and then (require 'ruff-format).

reformatter is required.

Usage

Customise the ruff-format-command variable as desired, then call ruff-format-buffer or ruff-format-region as convenient.

Enable ruff-format-on-save-mode in Python mode buffers like this:

(add-hook 'python-mode-hook 'ruff-format-on-save-mode)

...or locally to your project with a form in your .dir-locals.el like this:

((python-mode
   (mode . ruff-format-on-save)))

License

SPDX-License-Identifier: GPL-3.0-or-later