Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
d410b6f5
Commit
d410b6f5
authored
5 years ago
by
Loïc Correnson
Committed by
Virgile Prevosto
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[mdr] more verbose & robustified channel closing
parent
bd865df3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/markdown-report/md_gen.ml
+4
-6
4 additions, 6 deletions
src/plugins/markdown-report/md_gen.ml
src/plugins/markdown-report/sarif_gen.ml
+11
-11
11 additions, 11 deletions
src/plugins/markdown-report/sarif_gen.ml
with
15 additions
and
17 deletions
src/plugins/markdown-report/md_gen.ml
+
4
−
6
View file @
d410b6f5
...
@@ -621,12 +621,10 @@ let gen_report ~draft:is_draft () =
...
@@ -621,12 +621,10 @@ let gen_report ~draft:is_draft () =
::
elements
::
elements
in
in
let
doc
=
Markdown
.
pandoc
~
title
~
authors
elements
in
let
doc
=
Markdown
.
pandoc
~
title
~
authors
elements
in
let
file
=
Mdr_params
.
Output
.
get
()
in
try
try
let
out
=
open_out
(
Mdr_params
.
Output
.
get
()
)
in
Command
.
print_file
file
(
fun
fmt
->
Markdown
.
pp_pandoc
fmt
doc
)
;
let
fmt
=
Format
.
formatter_of_out_channel
out
in
Mdr_params
.
result
"Report %s generated"
file
Markdown
.
pp_pandoc
fmt
doc
;
close_out
out
with
Sys_error
s
->
with
Sys_error
s
->
Mdr_params
.
warning
Mdr_params
.
warning
"Unable to open %s for writing (%s). No report will be generated"
"Unable to open %s for writing (%s). No report generated"
file
s
(
Mdr_params
.
Output
.
get
()
)
s
This diff is collapsed.
Click to expand it.
src/plugins/markdown-report/sarif_gen.ml
+
11
−
11
View file @
d410b6f5
...
@@ -182,14 +182,14 @@ let gen_run remarks =
...
@@ -182,14 +182,14 @@ let gen_run remarks =
let
generate
()
=
let
generate
()
=
let
remarks
=
get_remarks
()
in
let
remarks
=
get_remarks
()
in
let
runs
=
[
gen_run
remarks
]
in
let
runs
=
[
gen_run
remarks
]
in
let
json
=
Schema
.
create
~
runs
()
in
let
json
=
Schema
.
create
~
runs
()
|>
Schema
.
to_yojson
in
let
out
=
Mdr_params
.
Output
.
get
()
in
let
file
=
Mdr_params
.
Output
.
get
()
in
let
chan
=
if
file
=
""
then
if
out
=
""
then
stdout
Log
.
print_on_output
(
fun
fmt
->
Yojson
.
Safe
.
pretty_print
fmt
json
)
else
begin
else
try
open_out
out
try
with
Sys_error
s
->
Command
.
write_file
file
Mdr_params
.
abort
"Unable to open output file %s: %s"
out
s
(
fun
out
->
Yojson
.
Safe
.
pretty_to_channel
~
std
:
true
out
json
)
;
end
Mdr_params
.
result
"Report %s generated"
file
in
with
Sys_error
s
->
Yojson
.
Safe
.
to_channel
chan
(
Schema
.
to_yojson
json
)
Mdr_params
.
abort
"Unable to generate %s (%s)"
file
s
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment