File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change 17
17
imports = [
18
18
( mkFormatterModule {
19
19
name = "shfmt" ;
20
- args = [
21
- "-s"
22
- "-w"
23
- ] ;
20
+ args = [ "-w" ] ;
24
21
includes = [
25
22
"*.sh"
26
23
"*.bash"
42
39
shfmt](https://github.com/patrickvane/shfmt#description).
43
40
'' ;
44
41
} ;
42
+
43
+ simplify = lib . mkOption {
44
+ type = lib . types . bool ;
45
+ default = true ;
46
+ description = ''
47
+ Enables the `-s` (`--simplify`) flag, which simplifies code where possible.
48
+ '' ;
49
+ } ;
45
50
} ;
46
51
47
52
config = lib . mkIf cfg . enable {
48
- settings . formatter . shfmt . options = lib . optionals ( ! isNull cfg . indent_size ) [
49
- "-i"
50
- ( toString cfg . indent_size )
51
- ] ;
53
+ settings . formatter . shfmt . options =
54
+ ( lib . optionals ( ! isNull cfg . indent_size ) [
55
+ "-i"
56
+ ( toString cfg . indent_size )
57
+ ] )
58
+ ++ ( lib . optionals ( cfg . simplify ) [ "-s" ] ) ;
52
59
} ;
53
60
}
You can’t perform that action at this time.
0 commit comments