mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
update emacs integration section to include emacs-ruff-format
(#9403)
## Summary For emacs users just seeking a ruff formatter, apheleia is overkill. Instead, a melpa package [emacs-ruff-format](https://github.com/scop/emacs-ruff-format) exists now. This change prepends a mention of this package, without removing apheleia as an alternative. ## Test Plan This is how I integrated ruff into my emacs.
This commit is contained in:
parent
e8d7a6dfce
commit
b6ce4f5f3a
1 changed files with 8 additions and 1 deletions
|
@ -334,7 +334,14 @@ Ruff is available as [`flymake-ruff`](https://melpa.org/#/flymake-ruff) on MELPA
|
|||
(add-hook 'python-mode-hook #'flymake-ruff-load)
|
||||
```
|
||||
|
||||
Ruff can be used as a formatter in Emacs using the [Apheleia](https://github.com/radian-software/apheleia) formatter library, by setting this configuration:
|
||||
Ruff is also available as [`emacs-ruff-format`](https://github.com/scop/emacs-ruff-format):
|
||||
|
||||
```elisp
|
||||
(require 'ruff-format)
|
||||
(add-hook 'python-mode-hook 'ruff-format-on-save-mode)
|
||||
```
|
||||
|
||||
Alternatively, it can be used via the [Apheleia](https://github.com/radian-software/apheleia) formatter library, by setting this configuration:
|
||||
|
||||
```emacs-lisp
|
||||
(add-to-list 'apheleia-mode-alist '(python-mode . ruff))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue