Remove flymake-collection, set mypy as default python check if available

This commit is contained in:
Evie Litherland-Smith 2024-05-22 07:55:13 +01:00
parent 366457ad84
commit 0258438c6d

16
init.el
View file

@ -894,8 +894,7 @@
(use-package flymake
:bind (("C-c C-." . flymake-goto-next-error)
("C-c C-," . flymake-goto-prev-error))
:hook (prog-mode . (lambda () (flymake-mode +1)))
:config (require 'flymake-collection))
:hook (prog-mode . (lambda () (flymake-mode +1))))
(use-package flymake-popon
:after flymake
@ -904,6 +903,7 @@
(global-flymake-popon-mode +1))
(use-package flymake-collection
:disabled
:after flymake
:custom
;; Extra mypy config
@ -985,15 +985,15 @@ Calls `project-remember-project-under' for ~/Projects/"
(display-fill-column-indicator-mode +1))
(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))))
:hook ((python-base-mode . (lambda () (my/enable-fill-column 88))))
:custom
(python-flymake-command
(cond ((executable-find "ruff") ("ruff" "check" "--output-format" "pylint" "-"))
((executable-find "flake8") ("flake8" "--max-line-length" "88" "-"))
(t ("pyflakes"))))
(cond ((executable-find "ruff") '("ruff" "check" "-e" "--output-format" "pylint" "-"))
((executable-find "flake8") '("flake8" "--max-line-length" "88" "-"))
(t '("pyflakes"))))
(python-check-command
(cond ((executable-find "ruff") "ruff check --output-format pylint")
(cond ((executable-find "mypy") "mypy --check-untyped-defs --warn-unreachable --show-error-codes")
((executable-find "ruff") "ruff check --output-format pylint")
((executable-find "flake8") "flake8 --max-line-length 88")
(t "pyflakes")))
:config