mirror of https://github.com/astral-sh/ruff
Improve Emacs configuration (#12070)
Replace black and combine `ruff check --select=I --fix` and `ruff format`.
This commit is contained in:
parent
9fec384d11
commit
2336c078e2
|
|
@ -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:
|
Alternatively, it can be used via the [Apheleia](https://github.com/radian-software/apheleia) formatter library, by setting this configuration:
|
||||||
|
|
||||||
```emacs-lisp
|
```emacs-lisp
|
||||||
(add-to-list 'apheleia-mode-alist '(python-mode . ruff))
|
;; Replace default (black) to use ruff for sorting import and formatting.
|
||||||
(add-to-list 'apheleia-mode-alist '(python-ts-mode . ruff))
|
(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)
|
## TextMate (Unofficial)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue