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