Commit graph

65 commits

Author SHA1 Message Date
sgherdao
c07e90793c
add support for pyang (#282)
Hi, 


pyang (https://github.com/mbj4668/pyang) is a YANG validator,
transformator and code generator, written in python. YANG (RFC 7950) is
a data modeling language for NETCONF (RFC 6241), developed by the IETF
NETMOD WG. This formatter provides support for Emacs yang-mode.

---------

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2024-02-08 17:56:49 -08:00
Chris Rose
96a9805ecb
Add ruff-isort formatter (#279)
`ruff` doesn't run isort as part of its format, so to maintain parity
with the sort rules that black/isort offer, this is the ruff isort.

---------

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2024-01-12 12:23:26 -07:00
Terje Larsen
1d6f821784
Add support for treefmt (#280)
This formatter is formatting via
[treefmt](https://numtide.github.io/treefmt). This is useful if the
project is configuring formatters for the project and you don't have to
replicate this logic within Emacs, but instead utilize treefmt directly.

To do that you can set the `apheleia-formatter` to `treefmt` within the
projects `.dir-locals.el`.

I noticed there are tests for this, since treefmt could technically
format anything, I went with treefmt formatting rust code. It also
relies on having a `treefmt.toml` in the project folder, so had to add
that as well in the tests.
2024-01-12 12:10:45 -07:00
Nolan
93f7480c96
Add ruby-syntax-tree format support (#224)
Add [ruby-syntax-tree](https://github.com/ruby-syntax-tree/syntax_tree)
as an available formatter. Include support for finding a [`.streerc`
file](https://github.com/ruby-syntax-tree/syntax_tree#configuration).

---------

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-12-21 20:34:11 -07:00
Michael Eliachevitch
4a87523f80
Add docformatter which formats Python docstrings to PEP 257 (#267)
Add [docformatter](https://github.com/PyCQA/docformatter) for Python
docstrings.

By default it outputs diffs but changes in-place with `--in-place`. On
successful change it exits with an error code of `3` (found out by
trial), so I had to add a formatter wrapping-script.

Initially I used `--in-place` with the special `in-place` symbol in
apheleia. But now I tried an approach where I transform the diff into
usable stdout using `patch` instead.

Related to #266 , where I had used the example of docformatter to ask
how to add scripts with positive exit codes and @raxod502 showed me the
`phpcs` solution.

---------

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-12-14 18:46:12 -08:00
Ville Skyttä
53c0389b5e
Add support for dprint (#249)
https://dprint.dev

---------

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-12-14 18:30:35 -08:00
Ville Skyttä
41dff902fb
Add support for JSON with python3 -m json.tool (#257)
https://docs.python.org/3/library/json.html#module-json.tool
2023-12-14 18:04:19 -08:00
dalu
a38279566a
Add support for cljfmt (#271) 2023-12-14 18:03:18 -08:00
dalu
c8d9ad43ba
Add denofmt (#264) 2023-11-29 19:25:11 +00:00
Ville Skyttä
56651724ad
Add support for Robot Framework files with robotidy (#263) 2023-11-28 22:50:25 +00:00
Mohsin Kaleem
01ca22bcd7
Add js-beautify based formatters (#229) 2023-11-26 10:49:21 +00:00
Abdelhak Bougouffa
515ee18092
Add support for SQL using pgformatter (#247)
Add support for [`pgFormatter`](https://github.com/darold/pgFormatter)
for `sql-mode`.

<!--

To expedite the pull request process, please see the contributor guide
for my projects:

  <https://github.com/raxod502/contributor-guide>

-->
2023-11-23 14:03:37 -08:00
Ville Skyttä
7adc80a310
Spelling and grammar fixes (#248) 2023-11-23 12:57:05 -08:00
Ville Skyttä
732efe4261
Add support for xmllint (#251)
<!--

To expedite the pull request process, please see the contributor guide
for my projects:

  <https://github.com/raxod502/contributor-guide>

-->

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-11-23 12:34:41 -08:00
Ville Skyttä
2b354f405b
Add support for yq (#250)
<!--

To expedite the pull request process, please see the contributor guide
for my projects:

  <https://github.com/raxod502/contributor-guide>

-->
2023-11-23 12:19:04 -08:00
Radon Rosborough
598ef3c7cb
Small fixes (#245)
Some things I noticed from
https://github.com/radian-software/apheleia/pull/242 but didn't want to
patch in place because CI had passed already.
2023-11-11 16:28:17 -08:00
Ed Slocomb
f884d1d611
Bump test environment to Ubuntu 22.04 (#242)
This also fixes a few test installers:

- rustfmt is available via apt-get in 22.04, use that instead of tarball
that's no longer available
- brittany now installs cleanly in the default haskell ghc/cabal in
22.04, so just use that
- perltidy in 22.04 has slightly different output
- nixfmt download url changed (now includes OS/arch). There was
initially no binary available when nixfmt was updated,
but the devs there were kind enough to provide one:
https://github.com/serokell/nixfmt/issues/139

This runs a full `make fmt-build` without errors, though it takes a
while ;). All tests pass, too.
2023-11-11 16:24:28 -08:00
Ed Slocomb
54a192c345
Add support for formatters locally installed via yarn 2+ pnp mode (#200)
This adds support for formatters installed locally in project
directories via yarn 2's "zero install" [pnp
mode](https://yarnpkg.com/features/pnp).

It's quite similar to the support for formatters installed locally in a
project's `node_modules` via npm, and leverages the `npx` symbol, so
existing formatter definitions should work without modification.

This checks for a `.pnp.cjs` file (expected in the project root for yarn
pnp projects), then looks for a yarn executable, and checks the version
of yarn to make sure it supports pnp. If that works, we just push
`"yarn"` onto the front of `command`.

I've only tested this with a locally installed `prettier.js`. It's very
much a works-for-me draft, I'm putting in a PR to make sure this is a
workable approach before going any further with it.

---------

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-11-05 12:08:58 -08:00
Chris Rose
392028d823
Add support for the ruff python formatter (#236)
This adds support, but does not make it the default
Fixes: #233

---------

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-11-04 18:23:00 +00:00
Dhananjay Balan
5bade7a734
Use hclfmt to format hashicorp HCL files. (#231)
Add formatter `hclfmt` for Hashicorp Configuration Langauge (HCL).
2023-10-29 15:17:34 -07:00
Mohsin Kaleem
51b8a796b6
Restructure and refactor apheleia package (#215)
CLOSES #212 

PR to restructure apheleia to make it more modular and improve some of
the separation of concerns. Before merging we should make sure that we
don't reintroduce the issues from #181.
2023-10-17 21:20:38 +01:00
Radon Rosborough
791346cd3a
Fix brittany formatter & misc improvements (#222)
* Fix brittany installation, needed the `--reorder-goals` argument to be
added so that a version that was not the latest version could be
installed so that it was compatible with the base lib version shipped
with Ubuntu 20.04. We'll upgrade to 22.04 eventually (before it falls
out of LTS). Ref: https://github.com/radian-software/apheleia/pull/221
* Add a `make fmt-build-common` target which allows tagging a docker
image containing just the base software and not any formatters, to make
it easy to debug formatter installation manually.
* Update `apheleia-ft` to also run formatter tests when any files
affecting a formatter are changed, which includes the installation
script, the sample input/output, and also any scripts (e.g.
`apheleia-phpcs`) that it uses. We don't have any logic that will run
all formatter tests at once, because that is unwieldy. That can be done
manually if making a big change.
* Update to actions/checkout@v4 from v2 because the older one was listed
as deprecated.
* Print full stacktraces when `apheleia-ft` fails with an Elisp error.
2023-10-06 22:01:38 -07:00
Ed Slocomb
35f72f6fbe
use up-to-date golang (#218)
While running a full `make fmt-build`, I got some failures with
installer scripts for golang formatters. This fixes the problem by
installing an up-to-date golang instead of the version available in
ubuntu 20.04.

The ppa used here, `longsleep/golang-backports` is
[recommended](https://github.com/golang/go/wiki/Ubuntu) by the Go
project.

---------

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-10-06 21:47:52 -07:00
Ed Slocomb
afa0e54e43
Add ormolu and fourmolu, remove brittany (#221)
Found while trying to `make fmt-build` that the installer for `brittany`
was broken, and couldn't fix it.

This removes brittany, and adds the ormolu and fourmolu formatters for
haskell, and sets ormolu as the default for haskell-mode.

---------

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-10-06 21:39:38 -07:00
Radon Rosborough
108176abe5 Update links 2023-08-26 09:05:35 -07:00
Ed Slocomb
706d6bd347
Add ruby-standard formatter (#201)
There are *so many* opinionated no-config ruby formatters ;)
2023-08-11 17:25:58 -07:00
Semen
f85b48e2ee
Add yapf formatter (#196)
<!--

To expedite the pull request process, please see the contributor guide
for my projects:

  <https://github.com/raxod502/contributor-guide>

-->
2023-05-27 10:55:56 -07:00
Mohsin Kaleem
e9e595f003
Add rufo formatter (#177) 2023-04-22 11:56:29 +01:00
Mohsin Kaleem
95bea3371b
Add rubocop formatter (#176) 2023-04-22 11:53:13 +01:00
Mohsin Kaleem
93c11bf5e3
Add perltidy formatter (#175) 2023-04-22 11:48:38 +01:00
Mohsin Kaleem
2686e7b17d
Add html-tidy formatter (#173) 2023-04-22 11:44:44 +01:00
Mohsin Kaleem
568862dc84
Add cmake-format formatter (#172) 2023-04-22 11:41:37 +01:00
Mohsin Kaleem
5cb7156ef5
Add buildifier formatter (#171) 2023-04-22 11:38:15 +01:00
Mohsin Kaleem
85a2ab7e5e
Add beautysh formatter (#170) 2023-04-22 11:34:12 +01:00
Mohsin Kaleem
0290ae18cc
Add astyle formatter (#169) 2023-04-22 10:36:38 +01:00
Mohsin Kaleem
bc6b72c05d
Add asmfmt formatter (#168) 2023-04-22 10:26:49 +01:00
Mohsin Kaleem
49890c3762
Add gawk formatter (#187) 2023-04-20 14:33:53 +01:00
Mohsin Kaleem
6516abee4a
Add jq formatter (#174) 2023-04-20 13:50:03 +01:00
Mohsin Kaleem
3abce6308e
Require apheleia-core to detect changed formatters (#186)
Fixes PR builds.
2023-04-20 12:46:59 +01:00
Mohsin Kaleem
ad728cfa76
Update existing formatters to use new formatter helper functions (#167) 2023-04-16 17:50:52 +01:00
Tomasz Hołubowicz
23c8b7d1ca
Add purs-tidy formatter (#182)
Hello!

I would like to add support for `purs-tidy` - PureScript formatter. 

Best wishes
alternateved
2023-03-29 14:35:02 -07:00
Mohsin Kaleem
edec1e61c8
Add various helper functions for defining formatters (#166) 2023-03-25 14:56:54 +00:00
Jay Barra
43ffed7890
Pretter svelte-mode (#178)
Adds support for `svelte-mode` using prettier.

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2023-03-23 14:00:51 -07:00
Radon Rosborough
782db66457 Fix formatter tests 2023-03-17 18:53:52 -07:00
Mohsin Kaleem
a7800ac50b Revert "Update tests to fix failures from formatter definition changes"
This reverts commit e2062d612d.
2023-03-12 10:50:44 +00:00
Mohsin Kaleem
e2062d612d Update tests to fix failures from formatter definition changes 2023-03-12 10:45:14 +00:00
Mohsin Kaleem
3e93610387
Separate formatters definitions from core apheleia library (#161)
Moves the bulk of apheleia.el into a new apheleia-core.el file and move
formatter definitions and mode-associations into a new
apheleia-formatters.el file. The end user experience should be
unchanged. Loading `apheleia.el` will still load everything load
everything, just like it used to.
2023-03-12 10:22:36 +00:00
Nikolai Prokoschenko
972b9906bf
Add formatter for Caddyfile (#154)
Add formatter for Caddyfile (#136)
2023-02-18 17:00:08 -08:00
Abin Simon
deab8fb972
Add gofumpt and goimports as formatter options (#147)
* Add gofumpt and goimports as formatter options

* Add tests for gofumpt and goimports

* changelog

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2022-12-10 02:07:34 +00:00
Billy.Zheng
823a81319f
Add Crystal lang support. (#137)
Thanks

Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
2022-10-24 17:42:15 -07:00