-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to NOT format certain files/buffers? #5
Comments
i understand the issue, but i'm not sure the emacs package can do something about this. to use black's exclusion configuration, that would need to live on the python side of the fence. if black would take a filename that could work, sth like so i guess alternatively, it could theoretically live inside black-macchiato (i know the maintainer quite well 🙃) but since a) it's not related to partial formatting and b) it likely requires poking into |
small addition, if black has a flag like that, this package is the right place to add it, reformatter.el lets us pass arbitrary flags, and a filename is easy to add. (see issue i linked above.) |
I'll think about that for a while. Would it be possible to do something with a file local variable that either |
you could make the enabling of the |
This is my python setup: (use-package python
:mode ("\\.py\\'" . python-mode)
:interpreter ("python" . python-mode)
:config
(use-package lsp-python-ms
:init (require 'lsp-python-ms))
(use-package py-isort)
(use-package python-black)
;; (use-package py-yapf)
:hook (
(python-mode . lsp-deferred)
(python-mode . py-isort-enable-on-save)
;; (python-mode . py-yapf-enable-on-save)
(python-mode . python-black-on-save-mode)
)
) |
that |
I have a project that's mostly under my control and I format all the things with black.
But, it has a subtree that is legacy code that has been copied in from another location. I'd like keep it in it's original formatting so as to minimize differences from it's upstream. Black has ways to ignore files/directories, but since python-black is running content through black via standard in, those exclusions don't seem to apply.
I'm not sure if there's something that I need to do in the python-mode universe or here in python-black, or in reformatter.el.
Any suggestions?
THANKS
The text was updated successfully, but these errors were encountered: