Commit 677941ae authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[lint] fix indentation

parent 801fde05
......@@ -128,8 +128,8 @@ class eva_coverage_vis ~from_entry_point = object(self)
if not from_entry_point then begin
Globals.Functions.iter_on_fundecs
(fun { svar } ->
Cil_datatype.Varinfo.Hashtbl.add
calls svar (is_analyzed_info svar no_call))
Cil_datatype.Varinfo.Hashtbl.add
calls svar (is_analyzed_info svar no_call))
end;
let vi =
Globals.Functions.get_vi
......@@ -171,10 +171,10 @@ let md_gen () =
Markdown.plain_format
"There are %d function definitions that are not stubbed. They represent \
%d statements, of which %d are potentially reachable through EVA, \
resulting in a **statement coverage of %.1f%%** with respect to the \
entire application."
resulting in a **statement coverage of %.1f%%** with respect to the \
entire application."
(nb_fundefs())
stats.total_stmts stats.covered_stmts
stats.total_stmts stats.covered_stmts
(float_of_int stats.covered_stmts *. 100. /.
float_of_int stats.total_stmts)
in
......
......@@ -37,7 +37,7 @@ let all_eva_domains =
"-eva-symbolic-locations-domain",
"domain computing ranges of variation for symbolic locations \
(e.g. `a[i]` when `i` is not precisely known by `Cvalue`)"
]
]
let insert_marks env anchor =
Comment "BEGIN_REMARK"
......@@ -66,19 +66,19 @@ let section_domains env =
let l = get_eva_domains () in
head
:: Block
(match l with
| [] ->
[Text
(plain
"Only the base domain (`Cvalue`) \
has been used for the analysis")]
| _ ->
[Text
(plain
"In addition to the base domain (`Cvalue`), additional \
domains have been used by EVA");
DL l]
)
(match l with
| [] ->
[Text
(plain
"Only the base domain (`Cvalue`) \
has been used for the analysis")]
| _ ->
[Text
(plain
"In addition to the base domain (`Cvalue`), additional \
domains have been used by EVA");
DL l]
)
:: insert_remark env anchor
end
......@@ -130,14 +130,14 @@ let section_stubs env =
if env.is_draft then insert_marks env anchor
else
(Block
[ Text
(Inline_code name ::
plain_format
"@[<h>is defined at %a@]" Cil_datatype.Location.pretty loc);
codelines "c"
Printer.pp_global
(GFun (Kernel_function.get_definition kf,loc))
])
[ Text
(Inline_code name ::
plain_format
"@[<h>is defined at %a@]" Cil_datatype.Location.pretty loc);
codelines "c"
Printer.pp_global
(GFun (Kernel_function.get_definition kf,loc))
])
:: insert_remark env anchor
in
H4 ([Inline_code name], Some anchor) :: content
......@@ -213,8 +213,8 @@ let gen_inputs env =
"You can add here some remarks about the set of files \
that is considered by Frama-C"
:: insert_marks env anchor
else
insert_remark env anchor
else
insert_remark env anchor
in
H2 (plain "Input files", Some anchor)
:: prelude
......@@ -268,11 +268,11 @@ let gen_context env =
@ section_domains env
@ H3 (plain "Stubbed Functions", Some "stubs")
:: (
if env.is_draft then
Comment
"You can add here general comments about the stubs that have been used"
:: insert_marks env "stubs"
else insert_remark env "stubs")
if env.is_draft then
Comment
"You can add here general comments about the stubs that have been used"
:: insert_marks env "stubs"
else insert_remark env "stubs")
@ section_stubs env
let gen_coverage env =
......@@ -471,7 +471,7 @@ let gen_section_alarms env =
in
(i+1,
sec @ H2 (sec_title, Some label) :: sec_content,
[ link; kind; emitter; func; loc_text ] :: content)
[ link; kind; emitter; func; loc_text ] :: content)
in
let _,sections, content = Alarms.fold treat_alarm (0,[],[]) in
let content = List.rev content in
......@@ -490,7 +490,7 @@ let gen_section_alarms env =
Plain "in a context matching the one used for the analysis";
Plain "will be immune from any undefined behavior."
]
]
]
:: insert_remark env anchor
in
H1 (plain "Results of the analysis", Some anchor) :: text_content
......@@ -618,9 +618,9 @@ let gen_report ~draft:is_draft () =
else elements
in
let elements =
Raw [ "\\let\\underscore\\_" ;
"\\renewcommand{\\_}{\\discretionary{\\underscore}{}{\\underscore}}"]
:: elements
Raw [ "\\let\\underscore\\_" ;
"\\renewcommand{\\_}{\\discretionary{\\underscore}{}{\\underscore}}"]
:: elements
in
let doc = Markdown.pandoc ~title ~authors elements in
try
......
......@@ -6,63 +6,63 @@ include Plugin.Register(
end)
module Output = String(
struct
let option_name = "-mdr-out"
let arg_name = "f"
let default = "report.md"
let help = "sets the name of the output file to <f>"
end)
struct
let option_name = "-mdr-out"
let arg_name = "f"
let default = "report.md"
let help = "sets the name of the output file to <f>"
end)
module Generate = String(
struct
let option_name = "-mdr-gen"
let arg_name = "kind"
let default = "none"
let help =
"select the <kind> of report to generate among: \
none (default), md, draft and sarif"
end)
struct
let option_name = "-mdr-gen"
let arg_name = "kind"
let default = "none"
let help =
"select the <kind> of report to generate among: \
none (default), md, draft and sarif"
end)
let () =
Generate.set_possible_values [ "none"; "md"; "draft"; "sarif" ]
module Remarks = Empty_string(
struct
let option_name = "-mdr-remarks"
let arg_name = "f"
let help =
"reads file <f> to add additional remarks to various sections of the report. \
Must be in a format compatible with the file produced by -mdr-gen-draft. \
Remarks themselves must be written in pandoc's markdown, although this is \
not enforced by the plug-in"
end
)
struct
let option_name = "-mdr-remarks"
let arg_name = "f"
let help =
"reads file <f> to add additional remarks to various sections of the report. \
Must be in a format compatible with the file produced by -mdr-gen-draft. \
Remarks themselves must be written in pandoc's markdown, although this is \
not enforced by the plug-in"
end
)
module FlameGraph = Empty_string(
struct
let option_name = "-mdr-flamegraph"
let arg_name = "f"
let help =
"reads file <f> to include a FlameGraph (https://github.com/brendangregg/FlameGraph.git),\
allowing the most analysis-intensive callstacks to be identified\
quickly and accurately"
end
)
struct
let option_name = "-mdr-flamegraph"
let arg_name = "f"
let help =
"reads file <f> to include a FlameGraph (https://github.com/brendangregg/FlameGraph.git),\
allowing the most analysis-intensive callstacks to be identified\
quickly and accurately"
end
)
module Authors = String_list(
struct
let option_name = "-mdr-authors"
let arg_name = "l"
let help = "list of authors of the report"
end)
struct
let option_name = "-mdr-authors"
let arg_name = "l"
let help = "list of authors of the report"
end)
module Title = Empty_string(
struct
let option_name = "-mdr-title"
let arg_name = "t"
let help = "title of the generated document"
end
)
struct
let option_name = "-mdr-title"
let arg_name = "t"
let help = "title of the generated document"
end
)
module Stubs = String_list(
struct
......
......@@ -63,26 +63,26 @@ module Message = struct
arguments: (string list [@default []]);
}[@@deriving yojson]
let create
?(text="")
?(messageId="")
?(richText="")
?(richMessageId="")
?(arguments=[])
()
=
{ text; messageId; richText; richMessageId; arguments }
let create
?(text="")
?(messageId="")
?(richText="")
?(richMessageId="")
?(arguments=[])
()
=
{ text; messageId; richText; richMessageId; arguments }
let plain_text ~text ?id:messageId ?arguments () =
create ~text ?messageId ?arguments ()
let plain_text ~text ?id:messageId ?arguments () =
create ~text ?messageId ?arguments ()
let markdown ~markdown ?id:richMessageId ?arguments () =
let richText =
String.trim (Format.asprintf "@[%a@]" Markdown.pp_elements markdown)
in
create ~richText ?richMessageId ?arguments ()
let markdown ~markdown ?id:richMessageId ?arguments () =
let richText =
String.trim (Format.asprintf "@[%a@]" Markdown.pp_elements markdown)
in
create ~richText ?richMessageId ?arguments ()
let default = create ()
let default = create ()
end
module FileLocation = struct
......@@ -103,55 +103,55 @@ module FileLocation = struct
end
module FileContent = struct
type t =
| Text of string [@name "text"]
| Binary of string [@name "binary"]
[@@deriving yojson]
type t =
| Text of string [@name "text"]
| Binary of string [@name "binary"]
[@@deriving yojson]
let default = Text ""
let default = Text ""
end
module Region = struct
type t = {
startLine: (int [@default 0]);
startColumn: (int [@default 0]);
endLine: (int [@default 0]);
endColumn: (int [@default 0]);
charOffset: (int [@default 0]);
charLength: (int [@default 0]);
byteOffset: (int [@default 0]);
byteLength: (int [@default 0]);
snippet: (FileContent.t [@default FileContent.default]);
message: (Message.t [@default Message.default])
}[@@deriving yojson]
let create
?(startLine = 0)
?(startColumn = 0)
?(endLine = 0)
?(endColumn = 0)
?(charOffset = 0)
?(charLength = 0)
?(byteOffset = 0)
?(byteLength = 0)
?(snippet = FileContent.default)
?(message = Message.default)
()
=
{ startLine; startColumn; endLine; endColumn; charOffset; charLength;
byteOffset; byteLength; snippet; message }
let default = create ()
let of_loc loc =
let open Filepath in
let (start, finish) = loc in
let startLine = start.pos_lnum in
let startColumn = start.pos_cnum - start.pos_bol in
let endLine = finish.pos_lnum in
let endColumn = finish.pos_cnum - finish.pos_bol in
let byteLength = finish.pos_cnum - start.pos_cnum in
create ~startLine ~startColumn ~endLine ~endColumn ~byteLength ()
type t = {
startLine: (int [@default 0]);
startColumn: (int [@default 0]);
endLine: (int [@default 0]);
endColumn: (int [@default 0]);
charOffset: (int [@default 0]);
charLength: (int [@default 0]);
byteOffset: (int [@default 0]);
byteLength: (int [@default 0]);
snippet: (FileContent.t [@default FileContent.default]);
message: (Message.t [@default Message.default])
}[@@deriving yojson]
let create
?(startLine = 0)
?(startColumn = 0)
?(endLine = 0)
?(endColumn = 0)
?(charOffset = 0)
?(charLength = 0)
?(byteOffset = 0)
?(byteLength = 0)
?(snippet = FileContent.default)
?(message = Message.default)
()
=
{ startLine; startColumn; endLine; endColumn; charOffset; charLength;
byteOffset; byteLength; snippet; message }
let default = create ()
let of_loc loc =
let open Filepath in
let (start, finish) = loc in
let startLine = start.pos_lnum in
let startColumn = start.pos_cnum - start.pos_bol in
let endLine = finish.pos_lnum in
let endColumn = finish.pos_cnum - finish.pos_bol in
let byteLength = finish.pos_cnum - start.pos_cnum in
create ~startLine ~startColumn ~endLine ~endColumn ~byteLength ()
end
module Rectangle = struct
......@@ -161,8 +161,8 @@ module Rectangle = struct
bottom: (float [@default 0.]);
right: (float [@default 0.]);
message: (Message.t [@default Message.default]);
}
[@@deriving yojson]
}
[@@deriving yojson]
end
module Custom_properties =
......@@ -214,11 +214,11 @@ module PhysicalLocation = struct
}[@@deriving yojson]
let create
?(id = "")
~fileLocation
?(region = Region.default)
?(contextRegion = Region.default)
()
?(id = "")
~fileLocation
?(region = Region.default)
?(contextRegion = Region.default)
()
=
{ id; fileLocation; region; contextRegion }
......@@ -241,12 +241,12 @@ module Location = struct
}[@@deriving yojson]
let create
~physicalLocation
?(fullyQualifiedLogicalName = "")
?(message = Message.default)
?(annotations = [])
?(properties = Properties.default)
()
~physicalLocation
?(fullyQualifiedLogicalName = "")
?(message = Message.default)
?(annotations = [])
?(properties = Properties.default)
()
=
{ physicalLocation; fullyQualifiedLogicalName;
message; annotations; properties;
......@@ -349,20 +349,20 @@ module CodeFlow = struct
end
module Sarif_exception = struct
type t = {
kind: (string [@default ""]);
message: (string [@default ""]);
stack: (Stack.t [@default Stack.default]);
innerExceptions: (t list [@default []]);
}[@@deriving yojson]
let default =
{
kind = "";
message = "";
stack = Stack.default;
innerExceptions = []
}
type t = {
kind: (string [@default ""]);
message: (string [@default ""]);
stack: (Stack.t [@default Stack.default]);
innerExceptions: (t list [@default []]);
}[@@deriving yojson]
let default =
{
kind = "";
message = "";
stack = Stack.default;
innerExceptions = []
}
end
module Notification_kind: sig
......@@ -428,7 +428,7 @@ end
module Invocation = struct
type t = {
type t = {
commandLine: string;
arguments: string list;
responseFiles: (FileLocation.t list [@default []]);
......@@ -458,32 +458,32 @@ type t = {
}[@@deriving yojson]
let create
~commandLine
?(arguments = [])
?(responseFiles = [])
?(attachments = [])
?(startTime = "")
?(endTime = "")
?(exitCode = 0)
?(toolNotifications = [])
?(configurationNotifications = [])
?(exitCodeDescription = "")
?(exitSignalName = "")
?(exitSignalNumber = 0)
?(processStartFailureMessage = "")
?(toolExecutionSuccessful = true)
?(machine = "")
?(account = "")
?(processId = 0)
?(executableLocation = FileLocation.default)
?(workingDirectory = FileLocation.default)
?(environmentVariables = Additional_properties.default)
?(stdin = FileLocation.default)
?(stdout = FileLocation.default)
?(stderr = FileLocation.default)
?(stdoutStderr = FileLocation.default)
?(properties = Properties.default)
()
~commandLine
?(arguments = [])
?(responseFiles = [])
?(attachments = [])
?(startTime = "")
?(endTime = "")
?(exitCode = 0)
?(toolNotifications = [])
?(configurationNotifications = [])
?(exitCodeDescription = "")
?(exitSignalName = "")
?(exitSignalNumber = 0)
?(processStartFailureMessage = "")
?(toolExecutionSuccessful = true)
?(machine = "")
?(account = "")
?(processId = 0)
?(executableLocation = FileLocation.default)
?(workingDirectory = FileLocation.default)
?(environmentVariables = Additional_properties.default)
?(stdin = FileLocation.default)
?(stdout = FileLocation.default)
?(stderr = FileLocation.default)
?(stdoutStderr = FileLocation.default)
?(properties = Properties.default)
()
=
{
commandLine;
......@@ -648,18 +648,18 @@ module File = struct
}[@@deriving yojson]
let create
?(fileLocation = FileLocation.default)
?(parentKey = "")
?(offset = 0)
?(length = 0)
?(roles = [])
?(mimeType = "")
?(contents = FileContent.default)
?(encoding = "")
?(hashes = [])
?(lastModifiedTime = "")
?(properties = Properties.default)
()
?(fileLocation = FileLocation.default)
?(parentKey = "")
?(offset = 0)
?(length = 0)
?(roles = [])
?(mimeType = "")
?(contents = FileContent.default)
?(encoding = "")
?(hashes = [])
?(lastModifiedTime = "")
?(properties = Properties.default)
()
=
{
fileLocation; parentKey; offset; length; roles; mimeType; contents;
......@@ -762,16 +762,16 @@ module Rule = struct
}
let create
~id
?(name="")
?(shortDescription=Message.default)
?(fullDescription=Message.default)
?(messageStrings=Additional_properties.default)
?(richMessageStrings=Additional_properties.default)
?(configuration=RuleConfiguration.default)
?(helpUri="")
?(properties=Properties.default)
()
~id
?(name="")
?(shortDescription=Message.default)
?(fullDescription=Message.default)
?(messageStrings=Additional_properties.default)
?(richMessageStrings=Additional_properties.default)
?(configuration=RuleConfiguration.default)
?(helpUri="")
?(properties=Properties.default)
()
=
{ id; name; shortDescription; fullDescription; messageStrings;
richMessageStrings; configuration; helpUri; properties }
......@@ -792,9 +792,9 @@ module Resources = struct
rules = [] }