mirror of
https://github.com/vale981/apheleia
synced 2025-03-04 17:11:40 -05:00
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:
parent
edec1e61c8
commit
23c8b7d1ca
5 changed files with 26 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
1
test/formatters/installers/purs-tidy.bash
Normal file
1
test/formatters/installers/purs-tidy.bash
Normal file
|
@ -0,0 +1 @@
|
|||
npm install -g purs-tidy
|
7
test/formatters/samplecode/purs-tidy/in.purs
Normal file
7
test/formatters/samplecode/purs-tidy/in.purs
Normal 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
|
10
test/formatters/samplecode/purs-tidy/out.purs
Normal file
10
test/formatters/samplecode/purs-tidy/out.purs
Normal 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
|
Loading…
Add table
Reference in a new issue