Skip to content

Commit

Permalink
Setup flycheck checkers
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Dec 7, 2024
1 parent 9dbcb80 commit b8de567
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -2807,13 +2807,7 @@ buffers to include `company-capf' (with optional yasnippet) and

;; Set buffer-local `flycheck' variables for checkers.
(setq-local flycheck-python-flake8-executable flake8-exec)
(setq-local flycheck-python-pylint-executable pylint-exec)

;; Dynamically configure next checkers.
(when flake8-exec
(flycheck-add-next-checker 'lsp 'python-flake8 t))
(when pylint-exec
(flycheck-add-next-checker 'lsp 'python-pylint t))))
(setq-local flycheck-python-pylint-executable pylint-exec)))

(defun setup-python-environment ()
"Custom configurations for `python-mode'."
Expand Down Expand Up @@ -2844,6 +2838,17 @@ buffers to include `company-capf' (with optional yasnippet) and
;; buffer (on demand).
(lsp-deferred)

;; Dynamically configure next Flycheck checkers.
(when flycheck-python-flake8-executable
(flycheck-add-next-checker 'lsp 'python-flake8 t))

(when flycheck-python-pylint-executable
(flycheck-add-next-checker 'lsp 'python-pylint t))

(when (not flycheck-python-mypy-executable)
(flycheck-remove-next-checker 'python-flake8 'python-mypy)
(flycheck-remove-next-checker 'python-pylint 'python-mypy))

(require 'dap-python)
;; ptvsd is depracated, and as of 8/10/2022, ptvsd caused dap to break
;; when it hits a breakpoint. This comment and issue has context:
Expand Down

0 comments on commit b8de567

Please sign in to comment.