apheleia icon indicating copy to clipboard operation
apheleia copied to clipboard

Add more powerful built in formatter descriptions

Open mohkale opened this issue 2 years ago • 5 comments

Hi,

Atm I'm maintaining a relatively large collection of formatters in my dotfiles and I'm curious whether there's any interest to backport some of them back into apheleia proper.

mohkale avatar Apr 09 '22 11:04 mohkale

Yep, I think that would be fantastic. See also https://github.com/lassik/emacs-format-all-the-code/issues/170, and specifically https://github.com/lassik/emacs-format-all-the-code/issues/170#issuecomment-1079740651, where I propose importing also the formatter definitions from format-all into the Apheleia format (or, really, into a new package that could be used as a dependency of both Apheleia and format-all, as well as potentially other formatting packages).

Looks like you've got some neat customization variables as well for your formatter definitions, I see no reason we can't include those as a new abstraction into Apheleia.

You've done a lot of good work for Apheleia in general, so, I'm also adding you as a collaborator on the repository, so you can more conveniently make quick fixes if you like. I'm still happy to review pull requests, but I trust your judgment.

raxod502 avatar Apr 10 '22 20:04 raxod502

Looks like you've got some neat customization variables as well for your formatter definitions, I see no reason we can't include those as a new abstraction into Apheleia.

Great. I'll try to open a PR a little later (might be busy for the foreseeable future). Since this doesn't seem like a core apheleia thing, I think it might be worth adding a new file like apheleia-formatters.el where these are defined. Thoughts?

You've done a lot of good work for Apheleia in general, so, I'm also adding you as a collaborator on the repository,

Great, thanks. I'll likely still defer to you for most changes since I'm relatively inexperienced maintaining packages like this but I appreciate the trust :-).

mohkale avatar Apr 10 '22 21:04 mohkale

doesn't seem like a core apheleia thing

Well, it kind of is insofar as they're required for basic operation if they are used in the default apheleia-formatters alist. But, it never hurts to spread code over multiple files, so I wouldn't see any issue with moving the formatter definition list, and all accompanying user options, to a separate file that is loaded from apheleia.el.

raxod502 avatar Apr 10 '22 21:04 raxod502

Makes sense. How's about we keep core definitions including formatters in apheleia.el and move the formatter runner to a separate apheleia-runner.el?

mohkale avatar Apr 10 '22 21:04 mohkale

That also seems fine to me. The interface to external callers is just that they will load apheleia.el and expect functions to be available, so as long as we load all the sub-files from apheleia.el, we can move these around as much as we want.

raxod502 avatar Apr 10 '22 21:04 raxod502

Going to go ahead and close this as resolved with #166.

mohkale avatar Apr 20 '23 12:04 mohkale