summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2025-07-03 19:05:47 +0100
committertslil clingman <tslil@posteo.de>2025-07-03 19:05:47 +0100
commitf37727eb6ee9e6929c2a4d7b86e035df8147fac6 (patch)
tree05e851aadcca9c57a17a9bb202b15dcfdd2d2722 /emacs
parentedc05ff2151169d79f3ff9a2d25005a0f6589373 (diff)
[emacs] make my own ruff stuff because everything doesn't dwiw
Diffstat (limited to 'emacs')
-rw-r--r--emacs/inits/20-programming.el47
1 files changed, 28 insertions, 19 deletions
diff --git a/emacs/inits/20-programming.el b/emacs/inits/20-programming.el
index 89dc13c..837a2e5 100644
--- a/emacs/inits/20-programming.el
+++ b/emacs/inits/20-programming.el
@@ -1,4 +1,4 @@
-;; Time-stamp: <2025-07-01 10h19 BST (anker)>
+;; Time-stamp: <2025-07-03 19h02 BST (anker)>
;; -----------------------------------------------------------------------------
;; General setup
@@ -26,7 +26,7 @@
(add-to-list 'eglot-server-programs
'(bqn-mode . ("bqnlsp")))
(add-to-list 'eglot-server-programs
- '(python-mode . ("pyright-langserver" "--stdio"))))
+ '(python-ts-mode . ("pyright-langserver" "--stdio"))))
(use-package treesit-auto
:custom
@@ -59,7 +59,7 @@
(when (not (eq major-mode 'text-mode))
(hs-minor-mode))
(setq auto-hscroll-mode t)
- (when (not (eq major-mode 'python-mode))
+ (when (not (eq major-mode 'python-ts-mode))
(keymap-set (current-local-map) "M-/" 'completion-at-point))
)
@@ -197,11 +197,21 @@
;; -----------------------------------------------------------------------------
;; Python
-(use-package lazy-ruff
- :ensure t
- :config
- (lazy-ruff-mode-global-toggle t)
- (setq lazy-ruff-check-command "ruff check --fix -s --select I"))
+
+(use-package reformatter
+ :ensure)
+
+(reformatter-define ruff-fix
+ :program "ruff"
+ :args (list "check" "--fix" input-file)
+ :stdout nil
+ :stdin nil)
+
+(reformatter-define ruff-format
+ :program "ruff"
+ :args (list "format" input-file)
+ :stdout nil
+ :stdin nil)
(use-package highlight-indent-guides
:ensure
@@ -211,18 +221,17 @@
highlight-indent-guides-auto-even-face-perc 5))
(use-package python
- :hook (python-mode . (lambda ()
- (require 'highlight-indent-guides)
- (highlight-indent-guides-mode t)
- (ruff-format-on-save-mode)
- (eglot-ensure)
- (visual-line-mode)))
-
- :bind (:map python-mode-map
+ :hook (python-ts-mode . (lambda ()
+ (require 'highlight-indent-guides)
+ (highlight-indent-guides-mode t)
+ (ruff-format-on-save-mode)
+ (ruff-fix-on-save-mode)
+ (eglot-ensure)
+ (visual-line-mode)))
+
+ :bind (:map python-ts-mode-map
("C-c C-f" . nil)
- ("M-/" . hippie-expand))
- :config
- (setq python-ts-mode-hook python-mode-hook))
+ ("M-/" . hippie-expand)))
;; -----------------------------------------------------------------------------
;; Rust