diff --git a/init.el b/init.el index 000b985..e640e10 100644 --- a/init.el +++ b/init.el @@ -926,9 +926,10 @@ :custom (apheleia-remote-algorithm 'local) :config (add-to-list 'apheleia-formatters '(alejandra . ("alejandra"))) + (add-to-list 'apheleia-formatters '(isort . ("isort" "--profile" "black" "-"))) (add-to-list 'apheleia-mode-alist '(nix-mode . alejandra)) - (add-to-list 'apheleia-mode-alist '(python-mode . (black isort))) - (add-to-list 'apheleia-mode-alist '(python-ts-mode . (black isort)))) + (add-to-list 'apheleia-mode-alist '(python-mode . (ruff isort))) + (add-to-list 'apheleia-mode-alist '(python-ts-mode . (ruff isort)))) (use-package flymake :bind (("C-c C-." . flymake-goto-next-error) @@ -1025,15 +1026,15 @@ Calls `project-remember-project-under' for ~/.config/, (use-package python :hook ((python-base-mode . (lambda () (my/enable-fill-column 88))) - (python-base-mode . (lambda () (add-hook 'flymake-diagnostic-functions - 'flymake-collection-mypy nil t)))) + (python-base-mode . (lambda () (add-hook 'flymake-diagnostic-functions 'flymake-collection-mypy nil t)))) :custom - ;; Set max line length for compatibility with black formatter (python-flymake-command - (cond ((executable-find "flake8") '("flake8" "--max-line-length" "88" "-")) + (cond ((executable-find "ruff") ("ruff" "check" "--output-format" "pylint" "-")) + ((executable-find "flake8") ("flake8" "--max-line-length" "88" "-")) (t ("pyflakes")))) (python-check-command - (cond ((executable-find "flake8") "flake8 --max-line-length 88") + (cond ((executable-find "ruff") "ruff check --output-format pylint") + ((executable-find "flake8") "flake8 --max-line-length 88") (t "pyflakes"))) :config (setq python-ts-mode-hook python-mode-hook))