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
84f54ed0
Commit
84f54ed0
authored
4 years ago
by
Andre Maroneze
Committed by
Virgile Prevosto
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Markdown-report] pretty-print paths and add baseUris
parent
b876bf4e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/markdown-report/sarif.ml
+2
-4
2 additions, 4 deletions
src/plugins/markdown-report/sarif.ml
src/plugins/markdown-report/sarif_gen.ml
+14
-2
14 additions, 2 deletions
src/plugins/markdown-report/sarif_gen.ml
with
16 additions
and
6 deletions
src/plugins/markdown-report/sarif.ml
+
2
−
4
View file @
84f54ed0
...
...
@@ -98,10 +98,8 @@ module ArtifactLocation = struct
let
default
=
create
~
uri
:
""
()
let
of_loc
loc
=
let
open
Filepath
in
(* by construction, we have an absolute path here, no need for uriBase *)
let
uri
=
((
fst
loc
)
.
pos_path
:>
string
)
in
create
~
uri
()
let
uriBaseId
,
uri
=
Filepath
.(
Normalized
.
to_base_uri
(
fst
loc
)
.
pos_path
)
in
create
~
uri
?
uriBaseId
()
end
module
ArtifactLocationDictionary
=
Json_dictionary
(
ArtifactLocation
)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/markdown-report/sarif_gen.ml
+
14
−
2
View file @
84f54ed0
...
...
@@ -159,7 +159,7 @@ let gen_statuses () =
let
gen_artifacts
()
=
let
add_src_file
f
=
let
uri
=
(
f
:
Filepath
.
Normalized
.
t
:>
string
)
in
let
uri
=
Filepath
.
Normalized
.
t
o_pretty_
string
f
in
let
location
=
ArtifactLocation
.
create
~
uri
()
in
let
roles
=
[
Role
.
analysisTarget
]
in
let
mimeType
=
"text/x-csrc"
in
...
...
@@ -192,7 +192,19 @@ let gen_run remarks =
let
taxonomies
=
[
ToolComponent
.
create
~
name
~
rules
()
]
in
let
results
=
results
@
user_annot_results
in
let
artifacts
=
gen_artifacts
()
in
Run
.
create
~
tool
~
invocations
~
results
~
taxonomies
~
artifacts
()
let
uriBases
=
(
"PWD"
,
Sys
.
getcwd
()
)
::
Filepath
.
all_symbolic_dirs
()
in
let
uriBasesJson
=
List
.
fold_left
(
fun
acc
(
name
,
dir
)
->
(
name
,
`Assoc
[(
"uri"
,
`String
dir
)])
::
acc
)
[]
uriBases
in
let
originalUriBaseIds
=
match
ArtifactLocationDictionary
.
of_yojson
(
`Assoc
uriBasesJson
)
with
|
Ok
x
->
x
|
Error
s
->
failwith
s
in
Run
.
create
~
tool
~
invocations
~
results
~
taxonomies
~
artifacts
~
originalUriBaseIds
()
let
generate
()
=
let
remarks
=
get_remarks
()
in
...
...
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