Skip to content
Snippets Groups Projects
Commit 3b43129b authored by Patrick Baudin's avatar Patrick Baudin Committed by Andre Maroneze
Browse files

[lint] handles indent formatter without update command

parent 8c62390a
No related branches found
No related tags found
No related merge requests found
...@@ -56,7 +56,7 @@ type formatter_cmds = ...@@ -56,7 +56,7 @@ type formatter_cmds =
{ mutable is_available : bool option ; { mutable is_available : bool option ;
available_cmd : string ; available_cmd : string ;
check_cmd: string ; check_cmd: string ;
update_cmd: string update_cmd: string (* leaves it empty if there is no updating command *)
} }
let c_indent_formatter = let c_indent_formatter =
...@@ -290,7 +290,9 @@ let check_indent ~indent_formatter ~update file = ...@@ -290,7 +290,9 @@ let check_indent ~indent_formatter ~update file =
if not @@ is_formatter_available indent_formatter then true if not @@ is_formatter_available indent_formatter then true
else if not update then else if not update then
0 = Sys.command (Format.sprintf "%s \"%s\"" indent_formatter.check_cmd file) 0 = Sys.command (Format.sprintf "%s \"%s\"" indent_formatter.check_cmd file)
else 0 = Sys.command (Format.sprintf "%s \"%s\"" indent_formatter.update_cmd file) else if indent_formatter.update_cmd <> "" then
0 = Sys.command (Format.sprintf "%s \"%s\"" indent_formatter.update_cmd file)
else true (* there no updating command *)
let res = ref true let res = ref true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment