File tree Expand file tree Collapse file tree 3 files changed +52
-1
lines changed Expand file tree Collapse file tree 3 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ functions.
221
221
<!-- `> bash ./supported-programs.sh` -->
222
222
223
223
<!-- BEGIN mdsh -->
224
- ` treefmt-nix ` currently supports 107 formatters:
224
+ ` treefmt-nix ` currently supports 108 formatters:
225
225
226
226
* [ actionlint] ( programs/actionlint.nix )
227
227
* [ alejandra] ( programs/alejandra.nix )
@@ -232,6 +232,7 @@ functions.
232
232
* [ buf] ( programs/buf.nix )
233
233
* [ buildifier] ( programs/buildifier.nix )
234
234
* [ cabal-fmt] ( programs/cabal-fmt.nix )
235
+ * [ cabal-gild] ( programs/cabal-gild.nix )
235
236
* [ clang-format] ( programs/clang-format.nix )
236
237
* [ cljfmt] ( programs/cljfmt.nix )
237
238
* [ cmake-format] ( programs/cmake-format.nix )
Original file line number Diff line number Diff line change
1
+ # Example generated by ../examples.sh
2
+ [formatter .cabal-gild ]
3
+ command = " cabal-gild-wrapper"
4
+ excludes = []
5
+ includes = [" *.cabal" , " cabal.project" , " cabal.project.local" ]
6
+ options = []
Original file line number Diff line number Diff line change
1
+ {
2
+ mkFormatterModule ,
3
+ lib ,
4
+ config ,
5
+ pkgs ,
6
+ ...
7
+ } :
8
+
9
+ let
10
+ cfg = config . programs . cabal-gild ;
11
+ in
12
+ {
13
+ meta . maintainers = [ ] ;
14
+
15
+ imports = [
16
+ ( mkFormatterModule {
17
+ name = "cabal-gild" ;
18
+ package = [
19
+ "haskellPackages"
20
+ "cabal-gild"
21
+ ] ;
22
+ includes = [
23
+ "*.cabal"
24
+ "cabal.project"
25
+ "cabal.project.local"
26
+ ] ;
27
+ } )
28
+ ] ;
29
+
30
+ config = lib . mkIf cfg . enable {
31
+ settings . formatter . cabal-gild = {
32
+ # cabal-gild doesn't support multiple file targets
33
+ # https://github.com/tfausak/cabal-gild/issues/35
34
+ command = pkgs . writeShellApplication {
35
+ name = "cabal-gild-wrapper" ;
36
+ text = ''
37
+ for file in "$@"; do
38
+ ${ lib . getExe cfg . package } --io="$file"
39
+ done
40
+ '' ;
41
+ } ;
42
+ } ;
43
+ } ;
44
+ }
You can’t perform that action at this time.
0 commit comments