Add purs-tidy formatter (#182)

Hello!

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

Best wishes
alternateved
This commit is contained in:
Tomasz Hołubowicz 2023-03-29 23:35:02 +02:00 committed by GitHub
parent edec1e61c8
commit 23c8b7d1ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 0 deletions

View file

@ -6,11 +6,17 @@ The format is based on [Keep a Changelog].
## Unreleased
### Enhancements
* Prettier is now enabled in `svelte-mode`.
### Bugs fixed
* `ktlint` would emit log messages into its stdout when formatting,
and these would get spliced into the source file. This has been fixed
by suppressing all logs from `ktlint`.
### Formatters
* [purs-tidy](https://github.com/natefaubion/purescript-tidy) for PureScript ([#182]).
[#182]: https://github.com/radian-software/apheleia/pull/182
## 3.2 (released 2023-02-25)
### Features
* You can use `apheleia-inhibit` as a file-local variable to disable

View file

@ -153,6 +153,7 @@ Otherwise return the extension only."
. (npx "prettier" "--stdin-filepath" filepath "--parser=typescript"))
(prettier-yaml
. (npx "prettier" "--stdin-filepath" filepath "--parser=yaml"))
(purs-tidy . (npx "purs-tidy" "format"))
(shfmt . ("shfmt" "-i" "4"))
(stylua . ("stylua" "-"))
(rustfmt . ("rustfmt" "--quiet" "--emit" "stdout"))
@ -265,6 +266,7 @@ rather than using this system."
(lua-mode . stylua)
(lisp-mode . lisp-indent)
(nix-mode . nixfmt)
(purescript-mode . purs-tidy)
(python-mode . black)
(python-ts-mode . black)
(ruby-mode . prettier-ruby)

View file

@ -0,0 +1 @@
npm install -g purs-tidy

View file

@ -0,0 +1,7 @@
module Foo where
baz ::Array(String)
-> Int->Boolean->Int
baz _ n
= case _ of
true-> 20 +1
false -> if n> 0 then 3-(-2)else 0

View file

@ -0,0 +1,10 @@
module Foo where
baz
:: Array (String)
-> Int
-> Boolean
-> Int
baz _ n = case _ of
true -> 20 + 1
false -> if n > 0 then 3 - (-2) else 0