From 92bbd6abef8c4df5d257687d873675aa59fee0ad Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 1 Jul 2024 18:09:39 +0100 Subject: [PATCH] Use black for python formatting, mypy ignore missing imports on check --- init.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/init.el b/init.el index 9c56d5d..74d2e6c 100644 --- a/init.el +++ b/init.el @@ -811,8 +811,7 @@ tempel-abbrev-mode) :bind (("M-+" . tempel-complete) ("M-*" . tempel-insert)) - :hook ((conf-mode prog-mode text-mode) . (lambda () - (add-hook 'completion-at-point-functions 'tempel-complete nil t))) + :hook ((conf-mode prog-mode text-mode) . (lambda () (add-hook 'completion-at-point-functions 'tempel-complete nil t))) :custom (tempel-trigger-prefix "<")) @@ -916,14 +915,14 @@ apheleia-mode-alist) :bind (("C-c c f" . apheleia-format-buffer)) :hook (prog-mode) - :custom (apheleia-remote-algorithm 'local) + :custom (apheleia-remote-algorithm 'cancel) :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-base-mode . ruff)) - (add-to-list 'apheleia-mode-alist '(python-mode . ruff)) - (add-to-list 'apheleia-mode-alist '(python-ts-mode . ruff))) + (add-to-list 'apheleia-mode-alist '(python-base-mode . (black isort))) + (add-to-list 'apheleia-mode-alist '(python-mode . (black isort))) + (add-to-list 'apheleia-mode-alist '(python-ts-mode . (black isort)))) (use-package flymake :bind (("C-c C-." . flymake-goto-next-error) @@ -1046,7 +1045,7 @@ Calls `project-remember-projects-under' for ~/Projects/" :custom (python-shell-interpreter "python3") (python-indent-def-block-scale 1) - (python-check-command "mypy --check-untyped-defs --warn-unreachable --show-error-codes") + (python-check-command "mypy --check-untyped-defs --warn-unreachable --show-error-codes --ignore-missing-imports") (python-flymake-command (cond ((executable-find "ruff") '("ruff" "check" "--output-format=pylint" "--stdin-filename=stdin" "-")) ((executable-find "flake8") '("flake8" "--max-line-length" "88" "-"))