Commit graph

26 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
Justin Smestad
8b9d576f2f
Add prettier-ruby (#49)
Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2021-10-03 11:18:03 -07:00
Justin Smestad
a1e8462dd3
Elixir support (#48)
* Add elixir formatter

* Fix format for elixir to use stdout

* Add CHANGELOG entry
2021-10-03 11:10:22 -07:00
PrimaryCanary
8e022c67fe
[DRAFT] More formatters (#24)
* Add Rust formatter rustfmt.

* Add LaTeX formatter latexindent.

There's a lot of LaTeX modes. I'm not sure how to distinguish them.

* Alphabetize apheleia-formatters and apheleia-mode-alist.

Alphabetizing them makes it easier to find which formatters are
supported.

* Add Java formatter with google-java-format.

* Add C and C++ formatter with clang-format.

* Update changelog

Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2021-08-08 06:07:08 -07:00
Matthew Avant
52e0a140a8
Update apheleia-formatters type spec to avoid customize-variable error (#40)
* Update apheleia-formatters type spec to avoid customize-variable error

Declare all of the permitted special symbols used in apheleia-formatters commands.
Without this, 'customize-variable never allows settting the value of apheleia-formatters, instead reporting an error about a mismatch between the default value and the type.

* Update CHANGELOG.md

* Break long line

* Update CHANGELOG.md

* Update CHANGELOG.md

* Create CHANGELOG.md

Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2021-07-22 19:16:42 -07:00
Radon Rosborough
f865c165da Avoid triggering after-set-visited-file-name-hook
This was causing LSP to reconnect every time I saved.
2021-05-23 15:00:07 -07:00
Radon Rosborough
64cb9e7d70 [#39] Don't mess up temporary buffers 2021-03-28 15:26:16 -07:00
Radon Rosborough
87115f5cda Revert "[#30] Run formatters in project root"
This reverts commit 66777303dc.

See https://github.com/raxod502/apheleia/issues/36,
https://github.com/raxod502/apheleia/pull/37 for discussion.
2021-03-14 13:31:23 -07:00
Radon Rosborough
b4975ca1bb Merge tag 'v1.1.2' 2021-02-26 22:04:53 -08:00
Radon Rosborough
53ac964e53 Release version 1.1.2 2021-02-26 22:04:05 -08:00
Radon Rosborough
f40300b9b5 [#32] Update changelog 2021-02-20 09:37:29 -08:00
Radon Rosborough
66777303dc [#30] Run formatters in project root 2021-02-18 20:06:50 -08:00
Albert Peschar
1ee7f3bc79
Fix infinite loop with rebinding after-save-hook (fixes #27) (#28)
* Fix infinite loop with rebinding after-save-hook (fixes #27)

* Satisfy linter

* Add docstring for new var

* Update changelog

* apheleia-format-buffer is asynchronous

* Update apheleia.el

Co-authored-by: Radon Rosborough <radon.neon@gmail.com>
2021-02-07 08:50:31 -08:00
Radon Rosborough
8a1e68441c Enable Prettier in json-mode 2020-11-07 07:04:41 -08:00
Radon Rosborough
3be4b486dc [#21] Make Prettier respect .prettierignore 2020-10-17 08:29:21 -07:00
Radon Rosborough
80e1b09dda Revert "Work around 2^16 buffer char limit"
Unfortunately, we need to address the problem more fundamentally. The
previous fix causes the end of the buffer to be truncated under some
circumstances.

This reverts commit c77a781912.
2020-08-23 14:38:45 -06:00
Radon Rosborough
c77a781912 Work around 2^16 buffer char limit 2020-08-23 13:09:43 -06:00
Radon Rosborough
6aff83d5ac Release version 1.1.1 2020-07-16 08:26:51 -06:00
Radon Rosborough
6bd6967179 Revert "[#15] Attempt to stop wrecking undo history"
This reverts commit 621351bade. It made
it impossible to undo reformatting operations.
2020-05-26 14:37:17 -06:00
Radon Rosborough
621351bade [#15] Attempt to stop wrecking undo history 2020-05-25 10:58:49 -06:00
Radon Rosborough
fe798e8824 Merge branch release 1.1 2020-04-02 08:58:41 -06:00
Radon Rosborough
c51a63a23e Release version 1.1 2020-04-02 08:54:06 -06:00
Radon Rosborough
d1eb2d200f Backport missing CHANGELOG entries 2020-04-02 08:53:31 -06:00
Radon Rosborough
58c850d1a6 Update changelog 2020-03-19 08:21:49 -06:00
Radon Rosborough
26ddaf3597 Fix bug running Prettier on modified buffer 2019-12-31 10:16:32 -07:00
Radon Rosborough
fab32d51a1 Release version 1.0 2019-09-20 17:12:09 -07:00