From ea9a5287a2351fefec147b3ada2577339939cda8 Mon Sep 17 00:00:00 2001 From: Ralf Zerres Date: Sun, 25 Jul 2021 12:48:55 +0200 Subject: [PATCH] 403-python-mode.el: move to use python-black * substitue y-autopep8 * python-black is actively developed Signed-off-by: Ralf Zerres --- site-start.d/403-python-mode.el | 34 +++++++-------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/site-start.d/403-python-mode.el b/site-start.d/403-python-mode.el index b055df3..ffb26f4 100644 --- a/site-start.d/403-python-mode.el +++ b/site-start.d/403-python-mode.el @@ -9,41 +9,21 @@ (add-hook 'python-mode-hook (lambda () (setq indent-tabs-mode nil) ; use only spaces and no tabs - (setq python-indent-offset 4) + ;;(setq py-indent-offset 4) ; defaults to 4 ;;(setq indent-tabs-mode t) ; use tabs to indent ;;(setq tabs-width 4) ; (add-to-list 'write-file-functions 'whitespace-cleanup))) - - (use-package 'py-autopep8 - :custom + (use-package python-black ;; Be complient with PIP 8 -- Style Guide ;; https://www.python.org/dev/peps/pep-0008/#indentation + :demand t + :custom + (python-black-on-save-mode-enable-dwim)) + (use-package 'py-autopep8 + :custom ;;(require 'py-autopep8) (py-autopep8-enable-on-save)) ) -;; (autoload 'python-mode "python-mode" -;; "Major mode for the python programming language" t) - -;; (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) -;; (add-to-list 'interpreter-mode-alist '("python" . python-mode)) - -;; ;; used, if working code is usings tabs (instead of PIP8 encuraged spaces) -;; ;;(add-hook 'python-mode-hook 'guess-style-guess-tabs-mode) -;; ;;(add-hook 'python-mode-hook (lambda () -;; ;; (guess-style-guess-tab-width))) - -;; ;; Be complient with PIP 8 -- Style Guide -;; ;; https://www.python.org/dev/peps/pep-0008/#indentation -;; ;;(require 'py-autopep8) - -;; (add-hook 'python-mode-hook -;; (lambda () -;; (setq indent-tabs-mode nil) ; use only spaces and no tabs -;; (setq python-indent-offset 4) -;; ;;(setq indent-tabs-mode t) ; use tabs to indent -;; ;;(py-autopep8-enable-on-save) -;; (add-to-list 'write-file-functions 'whitespace-cleanup))) - ;;; 403-python-mode.el ends here