ITADN

How do I disable a formatter or make one be used over the other?

#359Closedwhompyjaw 创建于 2025-04-18
W
whompyjawcommented
Thanks for the great package, but I am having a tricky time making it use `yapf` over `black`. I read your README.md and the docstring for `aphelia-formatters` and you don't provide any instruction on how to set a formatter as the default for a language. The closest instruction might be: ``` apheleia-formatter: Optional buffer-local variable specifying the formatter to use in this buffer. Overrides apheleia-mode-alist. You can set this in a local variables list, or in .dir-locals.el (e.g. ((python-mode . ((apheleia-formatter . (isort black)))))), or in a custom hook of your own that sets the local variable conditionally. ``` But I don't want to use a `.dir-locals.el` file. I want to use this globally (my work wants 2 spaces for python, so I have to do this for all python files I work on) Also, I think if you provided a "TLDR" code snippet that showed cookie-cutter ways to change aphelia for simple scenarios (like choosing one formatter over the other), that would be a lot more helpful than a wall of text explaining each variable. It's much easier to understand something when you see it in action. For example: ```elisp (use-package apheleia :config (setf ...) (push ...) (disable formatter ...) (make one priority over other ...)) ``` Thanks
关闭于 2025-04-21 6 条评论