Skip to content

Commit c81e462

Browse files
committed
Switch commands to let+ style
1 parent b8ef7bc commit c81e462

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

lib/dunolint_cli/src/cmd__lint.ml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@
2222
let main =
2323
Command.make
2424
~summary:"Lint project."
25-
(let%map_open.Command dunolint_engine_config = Dunolint_engine.Config.arg
26-
and () = Log_cli.set_config ()
27-
and config =
25+
(let open Command.Std in
26+
let+ dunolint_engine_config = Dunolint_engine.Config.arg
27+
and+ () = Log_cli.set_config ()
28+
and+ config =
2829
Arg.named_opt [ "config" ] Param.file ~doc:"Path to dunolint config file."
29-
and below = Common_helpers.below ~doc:"Lint only below this path."
30-
and enforce =
30+
and+ below = Common_helpers.below ~doc:"Lint only below this path."
31+
and+ enforce =
3132
Arg.named_multi
3233
[ "enforce" ]
3334
(Common_helpers.sexpable_param (module Dunolint.Condition))

lib/dunolint_cli/src/cmd__tools__lint_file.ml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,15 @@ let main =
151151
When the contents of the file is read from stdin, or if the file given does not \
152152
permit to recognize the linted file kind solely from its path, the name of the \
153153
file may be overridden.")
154-
(let%map_open.Command () = Log_cli.set_config ()
155-
and file =
154+
(let open Command.Std in
155+
let+ () = Log_cli.set_config ()
156+
and+ file =
156157
Arg.pos_opt
157158
~pos:0
158159
(Param.validated_string (module Fpath))
159160
~docv:"FILE"
160161
~doc:"Path to file to lint (by default reads from stdin)."
161-
and filename =
162+
and+ filename =
162163
Arg.named_opt
163164
[ "filename" ]
164165
(Param.validated_string (module Fpath))
@@ -168,23 +169,23 @@ let main =
168169
derive the linted file kind from its basename, but that path is not used to \
169170
load contents from disk. This may be used to override an actual file name or \
170171
to name the input when it comes from $(b,stdin)."
171-
and in_place =
172+
and+ in_place =
172173
Arg.flag
173174
[ in_place_switch ]
174175
~doc:
175176
"When the input is a regular file, you may use this option to save the linted \
176177
result in the file directly, instead of printing it to $(b,stdout). \
177178
Supplying this flag results in failure when the input is read from \
178179
$(b,stdin)."
179-
and config =
180+
and+ config =
180181
Arg.named_opt [ "config" ] Param.file ~doc:"Path to dunolint config file."
181-
and format_file =
182+
and+ format_file =
182183
Arg.named_with_default
183184
[ "format-file" ]
184185
Param.bool
185186
~default:true
186187
~doc:"Format file with after linting, using [dune format-dune-file]."
187-
and enforce =
188+
and+ enforce =
188189
Arg.named_multi
189190
[ "enforce" ]
190191
(Common_helpers.sexpable_param (module Dunolint.Condition))

0 commit comments

Comments
 (0)