From 6c095f4403b8c056eae8dd03d068009d161cbb7f Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 24 Feb 2025 10:33:20 +0000 Subject: [PATCH] Move python-check-command into file local hook --- init.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 4ece020..c6bdb24 100644 --- a/init.el +++ b/init.el @@ -1200,13 +1200,16 @@ (use-package python :hook ((python-base-mode . (lambda () - (set-fill-column 88) - (display-fill-column-indicator-mode +1) (setq-local python-flymake-command (cond ((executable-find "ruff" t) '("ruff" "check" "--output-format=concise" "--stdin-filename=stdin" "-")) ((executable-find "flake8" t) '("flake8" "--max-line-length" "88" "-")) - (t '("pyflakes"))))))) + (t '("pyflakes"))) + python-check-command + (cond + ((executable-find "basedpyright" t) "basedpyright") + ((executable-find "mypy" t) "mypy --check-untyped-defs --warn-unreachable --show-error-codes --ignore-missing-imports") + (t "pyflakes")))))) :custom (python-interpreter "python3") (python-shell-interpreter "python3") @@ -1215,7 +1218,6 @@ (python-indent-guess-indent-offset nil) (python-indent-offset 4) (python-indent-def-block-scale 1) - (python-check-command "mypy --check-untyped-defs --warn-unreachable --show-error-codes --ignore-missing-imports") :config (setq python-ts-mode-hook python-mode-hook))