File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed
Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ functions.
222222<!-- `> bash ./supported-programs.sh` -->
223223
224224<!-- BEGIN mdsh -->
225- ` treefmt-nix ` currently supports 120 formatters:
225+ ` treefmt-nix ` currently supports 121 formatters:
226226
227227* [ actionlint] ( programs/actionlint.nix )
228228* [ aiken] ( programs/aiken.nix )
@@ -338,6 +338,7 @@ functions.
338338* [ typos] ( programs/typos.nix )
339339* [ typstfmt] ( programs/typstfmt.nix )
340340* [ typstyle] ( programs/typstyle.nix )
341+ * [ wgslfmt] ( programs/wgslfmt.nix )
341342* [ xmllint] ( programs/xmllint.nix )
342343* [ yamlfmt] ( programs/yamlfmt.nix )
343344* [ yapf] ( programs/yapf.nix )
Original file line number Diff line number Diff line change 1+ # Example generated by ../examples.sh
2+ [formatter .wgslfmt ]
3+ command = " wgslfmt"
4+ excludes = []
5+ includes = [" *.wgsl" ]
6+ options = []
Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ config ,
4+ mkFormatterModule ,
5+ ...
6+ } :
7+ let
8+ cfg = config . programs . wgslfmt ;
9+ in
10+ {
11+ meta . maintainers = [ ] ;
12+
13+ imports = [
14+ ( mkFormatterModule {
15+ name = "wgslfmt" ;
16+ package = "wgsl-analyzer" ;
17+ mainProgram = "wgslfmt" ;
18+ includes = [ "*.wgsl" ] ;
19+ } )
20+ ] ;
21+
22+ options . programs . wgslfmt = {
23+ tabs = lib . mkEnableOption "Use tabs for indentation (instead of spaces)" ;
24+ } ;
25+
26+ config = lib . mkIf cfg . enable {
27+ settings . formatter . wgslfmt . options = lib . optional cfg . tabs "--tabs" ;
28+ } ;
29+ }
You can’t perform that action at this time.
0 commit comments