From b6ce4f5f3a9d09931468e3137af70562c982987e Mon Sep 17 00:00:00 2001 From: port19 Date: Sun, 14 Jan 2024 03:55:51 +0100 Subject: [PATCH] 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. --- docs/integrations.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/integrations.md b/docs/integrations.md index efefdb0255ff9..6cc40bb1cb585 100644 --- a/docs/integrations.md +++ b/docs/integrations.md @@ -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))