[feat] combine pylint and pyright-lsp
This commit is contained in:
parent
86588ecab6
commit
4abd34b8b4
1 changed files with 19 additions and 0 deletions
19
config.org
19
config.org
|
@ -641,3 +641,22 @@
|
|||
|
||||
(add-to-list 'window-buffer-change-functions 'my/track-python-virtualenv)
|
||||
#+end_src
|
||||
|
||||
同时启用 pylint 和 pyright-lsp 。
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defvar-local my/flycheck-local-cache nil)
|
||||
|
||||
(defun my/flycheck-checker-get (fn checker property)
|
||||
(or (alist-get property (alist-get checker my/flycheck-local-cache))
|
||||
(funcall fn checker property)))
|
||||
|
||||
(advice-add 'flycheck-checker-get :around 'my/flycheck-checker-get)
|
||||
|
||||
(add-hook 'lsp-managed-mode-hook
|
||||
(lambda ()
|
||||
(when (and (string= nil (file-remote-p default-directory))
|
||||
(derived-mode-p 'python-mode))
|
||||
(setq my/flycheck-local-cache '((lsp . ((next-checkers . (python-pylint)))))))))
|
||||
|
||||
#+end_src
|
||||
|
|
Loading…
Reference in a new issue