Skip to content

Commit 1808632

Browse files
authored
feat: add hy support (#241)
1 parent e9331df commit 1808632

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Supported languages
5656
* **Haskell** ([*brittany*](https://github.com/lspitzner/brittany), [*fourmolu*](https://github.com/fourmolu/fourmolu), [*hindent*](https://github.com/commercialhaskell/hindent), [*ormolu*](https://github.com/tweag/ormolu), [*stylish-haskell*](https://github.com/jaspervdj/stylish-haskell))
5757
* **HCL** ([*hclfmt*](https://github.com/hashicorp/hcl/tree/main/cmd/hclfmt))
5858
* **HTML/XHTML/XML** ([*tidy*](http://www.html-tidy.org/))
59+
* **Hy** (Emacs)
5960
* **Java** ([*clang-format*](https://clang.llvm.org/docs/ClangFormat.html), [*astyle*](http://astyle.sourceforge.net/))
6061
* **JavaScript/JSON/JSX** ([*prettier*](https://prettier.io/), [*standard*](https://standardjs.com/), [*prettierd*](https://github.com/fsouza/prettierd), [*deno*](https://deno.land/manual/tools/formatter))
6162
* **Jsonnet** ([*jsonnetfmt*](https://jsonnet.org/))

format-all.el

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
;; - Haskell (brittany, fourmolu, hindent, ormolu, stylish-haskell)
5858
;; - HCL (hclfmt)
5959
;; - HTML/XHTML/XML (tidy)
60+
;; - Hy (Emacs)
6061
;; - Java (clang-format, astyle)
6162
;; - JavaScript/JSON/JSX (prettier, standard, prettierd, deno)
6263
;; - Jsonnet (jsonnetfmt)
@@ -157,6 +158,7 @@
157158
("HTML" html-tidy)
158159
("HTML+EEX" mix-format)
159160
("HTML+ERB" erb-format)
161+
("Hy" emacs-hy)
160162
("Java" clang-format)
161163
("JavaScript" prettier)
162164
("JSON" prettier)
@@ -898,6 +900,18 @@ Consult the existing formatters for examples of BODY."
898900
(lambda () (indent-region (car region) (cdr region)))
899901
(lambda () (indent-region (point-min) (point-max)))))))
900902

903+
(define-format-all-formatter emacs-hy
904+
(:executable)
905+
(:install)
906+
(:languages "Hy")
907+
(:features region)
908+
(:format
909+
(format-all--buffer-native
910+
'hy-mode
911+
(if region
912+
(lambda () (indent-region (car region) (cdr region)))
913+
(lambda () (indent-region (point-min) (point-max)))))))
914+
901915
(define-format-all-formatter erb-format
902916
(:executable "erb-format")
903917
(:install "gem install erb-formatter")

0 commit comments

Comments
 (0)