From 2a2ee421d2b2c4b2609198ba0308d1f457c94f7c Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Sun, 22 Mar 2020 09:55:39 -0400 Subject: [PATCH] add python-black --- emacs.d/custom.el | 2 +- emacs.d/layers/python/init.el | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/emacs.d/custom.el b/emacs.d/custom.el index 775457f..c17e376 100644 --- a/emacs.d/custom.el +++ b/emacs.d/custom.el @@ -4,7 +4,7 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(package-selected-packages - '(cython-mode scss-mode vue-mode tide rust-mode company-auctex tex-site auctex sphinx-doc company-lsp lsp-ui lsp-mode ws-butler use-package smartparens pip-requirements osx-clipboard monokai-theme markdown-mode helm-projectile helm-ag godoctor go-guru go-eldoc go-autocomplete flycheck-gometalinter doom-modeline dockerfile-mode docker-compose-mode diminish company-go company-anaconda))) + '(python-black cython-mode scss-mode vue-mode tide rust-mode company-auctex tex-site auctex sphinx-doc company-lsp lsp-ui lsp-mode ws-butler use-package smartparens pip-requirements osx-clipboard monokai-theme markdown-mode helm-projectile helm-ag godoctor go-guru go-eldoc go-autocomplete flycheck-gometalinter doom-modeline dockerfile-mode docker-compose-mode diminish company-go company-anaconda))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/emacs.d/layers/python/init.el b/emacs.d/layers/python/init.el index aa2631a..532bca9 100644 --- a/emacs.d/layers/python/init.el +++ b/emacs.d/layers/python/init.el @@ -26,5 +26,12 @@ :hook (python-mode . sphinx-doc-mode) :commands sphinx-docs-mode) +;; Enable `black`ing files +;; https://github.com/wbolster/emacs-python-black +(use-package python-black + :demand t + :after python + :hook (python-mode . python-black-on-save-mode)) + ;; Enable Flycheck for python (enable-flycheck 'python-mode-hook)