Commit graph

8 commits

Author SHA1 Message Date
Mohsin Kaleem
1bf7db7477
Support multiple formatters (#31) (#51)
* Support multiple formatters (#31)

Closes #31

This commit makes it so apheleia can run multiple formatters one after
the other and use the resultant output to format the current buffer.
This works somewhat like a pipeline. The output of one formatter becomes
the input to the next formatter until all formatters have run and then
an RCS patch is built from the resultant output and applied to the
current buffer.

Note: For convenience we internally represent the users configuration as
a list of formatters even when it may only be one. For example if the
user has configured `(python-mode . black)` in apheleia-mode-alist then
internally we interpret that as a formatter list of `(black)` instead of
`black` as we did previously.

* Support multiple formatters (#31)

Closes #31

This commit makes it so apheleia can run multiple formatters one after
the other and use the resultant output to format the current buffer.
This works somewhat like a pipeline. The output of one formatter becomes
the input to the next formatter until all formatters have run and then
an RCS patch is built from the resultant output and applied to the
current buffer.

Note: For convenience we internally represent the users configuration as
a list of formatters even when it may only be one. For example if the
user has configured `(python-mode . black)` in apheleia-mode-alist then
internally we interpret that as a formatter list of `(black)` instead of
`black` as we did previously.

* Make some changes

* Make some changes

* Error when a (not-first) formatter uses file or filepath

* Prevent formatter recieving stdin when using `file'

Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2021-10-24 18:28:18 -07:00
Radon Rosborough
3e342632b8 [#14] Explain how to modify alist 2020-05-10 10:32:04 -06:00
Radon Rosborough
bd61b7204d Link to contributor guide 2020-05-03 08:30:02 -06:00
Radon Rosborough
707930e247 Document apheleia-max-alignment-size 2020-03-19 08:21:18 -06:00
Radon Rosborough
68d8755333 Migrate from Semaphore CI to CircleCI 2019-11-16 22:01:04 -08:00
Radon Rosborough
e28a264989 Disable automatically for remote files 2019-09-20 17:08:43 -07:00
Radon Rosborough
903d6b810c Add apheleia-post-format-hook 2019-07-17 11:26:52 -07:00
Radon Rosborough
f2ae6c7f29 Add basic documentation 2019-07-10 22:50:08 -07:00