Add instructions for configuration of Emacs (#8488)

## Summary

Add editor integration docs for `ruff format` in Emacs by way of the
Apheleia formatter library

Depends on:  https://github.com/radian-software/apheleia/issues/233
This commit is contained in:
Chris Rose 2023-11-05 09:15:59 -08:00 committed by GitHub
parent 1672a3d3b7
commit 72ebde8d38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -331,6 +331,13 @@ Ruff is available as [`flymake-ruff`](https://melpa.org/#/flymake-ruff) on MELPA
(add-hook 'python-mode-hook #'flymake-ruff-load) (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:
```emacs-lisp
(add-to-list 'apheleia-mode-alist '(python-mode . ruff))
(add-to-list 'apheleia-mode-alist '(python-ts-mode . ruff))
```
## TextMate (Unofficial) ## TextMate (Unofficial)
Ruff is also available via the [`textmate2-ruff-linter`](https://github.com/vigo/textmate2-ruff-linter) Ruff is also available via the [`textmate2-ruff-linter`](https://github.com/vigo/textmate2-ruff-linter)