Improve Emacs configuration (#12070)

Replace black and combine `ruff check --select=I --fix` and `ruff
format`.
This commit is contained in:
Étienne BERSAC
2024-06-28 09:39:29 +02:00
committed by GitHub
parent 9fec384d11
commit 2336c078e2

View File

@@ -304,8 +304,11 @@ Ruff is also available as [`emacs-ruff-format`](https://github.com/scop/emacs-ru
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))
(add-to-list 'apheleia-mode-alist '(python-ts-mode . ruff))
;; Replace default (black) to use ruff for sorting import and formatting.
(setf (alist-get 'python-mode apheleia-mode-alist)
'(ruff-isort ruff))
(setf (alist-get 'python-ts-mode apheleia-mode-alist)
'(ruff-isort ruff))
```
## TextMate (Unofficial)