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
97784ac9
Commit
97784ac9
authored
6 years ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
[sarif] generate information about input files
parent
3e0a66ab
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
+19
-0
19 additions, 0 deletions
src/plugins/markdown-report/sarif.ml
src/plugins/markdown-report/sarif_gen.ml
+12
-1
12 additions, 1 deletion
src/plugins/markdown-report/sarif_gen.ml
with
31 additions
and
1 deletion
src/plugins/markdown-report/sarif.ml
+
19
−
0
View file @
97784ac9
...
...
@@ -644,6 +644,25 @@ module File = struct
lastModifiedTime
:
(
string
[
@
default
""
]);
properties
:
(
Properties
.
t
[
@
default
Properties
.
default
]);
}[
@@
deriving
yojson
]
let
create
?
(
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
;
encoding
;
hashes
;
lastModifiedTime
;
properties
}
end
module
FileChange
=
struct
...
...
This diff is collapsed.
Click to expand it.
src/plugins/markdown-report/sarif_gen.ml
+
12
−
1
View file @
97784ac9
...
...
@@ -50,11 +50,22 @@ let gen_results remarks =
let
_
,
content
=
Alarms
.
fold
treat_alarm
(
0
,
[]
)
in
List
.
rev
content
let
gen_files
()
=
let
add_src_file
f
=
let
key
=
Filename
.
chop_extension
(
Filename
.
basename
f
)
in
let
fileLocation
=
FileLocation
.
create
~
uri
:
(
Filepath
.
normalize
f
)
()
in
let
roles
=
[
Role
.
analysisTarget
]
in
let
mimeType
=
"text/x-csrc"
in
key
,
File
.
create
~
fileLocation
~
roles
~
mimeType
()
in
List
.
map
add_src_file
(
Kernel
.
Files
.
get
()
)
let
gen_run
remarks
=
let
tool
=
frama_c_sarif
in
let
invocations
=
[
gen_invocation
()
]
in
let
results
=
gen_results
remarks
in
Run
.
create
~
tool
~
invocations
~
results
()
let
files
=
gen_files
()
in
Run
.
create
~
tool
~
invocations
~
results
~
files
()
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