Use black for python formatting, mypy ignore missing imports on check

This commit is contained in:
Evie Litherland-Smith 2024-07-01 18:09:39 +01:00
parent ce80658ac8
commit 92bbd6abef

13
init.el
View file

@ -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" "-"))