Set python formatter to use black

Set max-line-length for flake8, for compatibility with black

Add "~/.local/bin/" to tramp remote search paths
This commit is contained in:
Evie Litherland-Smith 2024-04-26 14:05:00 +01:00
parent 22aa67ccfb
commit 81a7715ab6

12
init.el
View file

@ -963,8 +963,8 @@ Try `magit-clone-default-directory' if available, fall back to
:config
(add-to-list 'apheleia-formatters '(alejandra . ("alejandra")))
(add-to-list 'apheleia-mode-alist '(nix-mode . alejandra))
(add-to-list 'apheleia-mode-alist '(python-mode . (ruff isort)))
(add-to-list 'apheleia-mode-alist '(python-ts-mode . (ruff isort))))
(add-to-list 'apheleia-mode-alist '(python-mode . (black isort)))
(add-to-list 'apheleia-mode-alist '(python-ts-mode . (black isort))))
(use-package flymake
:bind (("C-c C-." . flymake-goto-next-error)
@ -1048,11 +1048,12 @@ Try `magit-clone-default-directory' if available, fall back to
(python-base-mode . (lambda () (add-hook 'flymake-diagnostic-functions
'flymake-collection-mypy nil t))))
:custom
;; Set max line length for compatibility with black formatter
(python-flymake-command
(cond ((executable-find "flake8") '("flake8" "-"))
(cond ((executable-find "flake8") '("flake8" "--max-line-length" "88" "-"))
(t ("pyflakes"))))
(python-check-command
(cond ((executable-find "flake8") "flake8")
(cond ((executable-find "flake8") "flake8 --max-line-length 88")
(t "pyflakes")))
:config
(setq python-ts-mode-hook python-mode-hook))
@ -1063,7 +1064,8 @@ Try `magit-clone-default-directory' if available, fall back to
(use-package tramp
:defer t
:config
(add-to-list 'tramp-remote-path 'tramp-own-remote-path))
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
(add-to-list 'tramp-remote-path "~/.local/bin/"))
(connection-local-set-profile-variables
'remote-disable-apheleia