Syntax checking for python

This commit is contained in:
Petr Nyc
2026-01-17 20:29:28 +01:00
parent ab11fc8566
commit d80bca7f00

View File

@@ -41,7 +41,10 @@ This function should only modify configuration layer settings."
nginx nginx
toml toml
html html
python (python :variables
python-backend 'lsp
python-lsp-server 'pyright
)
javascript javascript
pandoc pandoc
;; ---------------------------------------------------------------- ;; ----------------------------------------------------------------
@@ -762,6 +765,42 @@ before packages are loaded."
;; / email config ;; / email config
;; LSP config
;; General LSP tuning - defaults
;; (setq lsp-idle-delay 0.5)
;; (setq lsp-log-io nil)
;; (setq gc-cons-threshold 100000000)
;; (setq read-process-output-max (* 1024 1024)) ;; 1MB
;; Use flycheck for diagnostics (Spacemacs default)
;; (setq lsp-diagnostics-provider :flycheck)
;; Reduce file watcher overhead (important for Terraform repos)
;; (setq lsp-file-watch-threshold 5000)
;; for python, install ruff and pylsp:
;; Python CONFIG
;; brew install ruff pylsp pyright basedpyright
;; 1. Use Basedpyright instead of standard Pyright
(setq lsp-pyright-langserver-command "basedpyright")
;; 2. Enable Ruff support (requires ruff to be in your PATH)
;; This tells lsp-mode to use the Ruff server for linting/formatting
(setq lsp-pylsp-plugins-ruff-enabled t)
;; Spacemacs already uses deferred loading, but this ensures it
;; (setq lsp-auto-configure t) ;; this is already default
;; /Python CONFIG
;; enable lsp mode for shells, needs to be deferred
;; otherwise it locks up emacs startup
(add-hook 'sh-mode-hook #'lsp-deferred)
;; / LSP config
;; jira config ;; jira config
;; (defun my-jira-bearer-token () ;; (defun my-jira-bearer-token ()
@@ -1031,9 +1070,6 @@ before packages are loaded."
(with-eval-after-load 'markdown-mode (with-eval-after-load 'markdown-mode
(define-key markdown-mode-map (kbd "C-c x") 'my/markdown-toggle-checkbox)) (define-key markdown-mode-map (kbd "C-c x") 'my/markdown-toggle-checkbox))
;; (with-eval-after-load 'flycheck
;; (flycheck-add-next-checker 'lsp '(warning . json-jsonlint)))
(setq calendar-week-start-day 1) ;; calendar start on Monday (setq calendar-week-start-day 1) ;; calendar start on Monday
;; org-alert configuration ;; org-alert configuration