From 4929a564c67cf06ce7fa88372b674e5c6a80e618 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 4 Jun 2025 22:47:14 +0300 Subject: [PATCH] Automatically remove unused imports when saving Python files --- .config/emacs/init.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 84749fb..8bb68b0 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -197,6 +197,14 @@ :config (apheleia-global-mode) (setf (alist-get 'emacs-lisp-mode apheleia-mode-alist nil 'remove) nil) + (setf (alist-get 'ruff-isort apheleia-formatters) + '("ruff" "check" + "-n" + "--select" "I" + "--select" "F401" + "--fix" "--fix-only" + "--stdin-filename" filepath + "-")) (setf (alist-get 'python-mode apheleia-mode-alist) '(ruff-isort ruff)) (setf (alist-get 'python-ts-mode apheleia-mode-alist)