Today we have header-level data in ScanCode data that is a tad ad-hoc. For instance:
{
"scancode_notice": "Generated with ScanCode...",
"scancode_version": "2.1.0.post55.ff2948e",
"scancode_options": {
"--info": true,
"--format": "json-pp"
},
"files_count": 1,
..files, etc ... regular ABC Data.....
}
We should normalize this and support having multiple tools providing some log that they touched the data.
Here is what I suggest: store these in a top level "header" attribute. This attribute would contain a list. Each list item would be an object.
With this in mind the new ScanCode output would look like this:
{
"header" : [
{
"tool": "scancode-toolkit",
"tool_version": "2.1.0.post55.ff2948e",
"date": "2017-09-12T12:23:12",
"scancode_notice": "Generated with ScanCode...",
"scancode_options": {
"--info": true,
"--format": "json-pp"
},
"files_count": 1,
[.... any other attributes that a tool may want to add, such as a scanned path, etc] ,
}
]
..files, etc ... regular ABC Data.....
}
And with several tools having "touched" the data:
{
"header" : [
{
"tool": "scancode-toolkit",
"tool_version": "2.1.0.post55.ff2948e",
"date": "2017-09-12T12:23:12",
"scancode_notice": "Generated with ScanCode...",
"scancode_options": {
"--info": true,
"--format": "json-pp"
},
"files_count": 1,
[.... any other attributes that a tool may want to add, such as a scanned path, etc] ,
},
{
"tool": "aboutcode-mamanger",
"tool_version": "3.1.0",
"date": "2017-09-13T15:23:12",
[.... any other attributes that a tool may want to add, such as a scanned path, etc] ,
},
{
"tool": "vulnerablecode",
"tool_version": "0.1.0",
"date": "2017-09-13T16:23:12",
[.... any other attributes that a tool may want to add, such as a scanned path, etc] ,
}
]
..files, component, packages etc ... e.g. regular ABC Data.....
}
In this context these would be the only fields that are expected in a header item:
"tool": "aboutcode-mamanger",
"tool_version": "3.1.0",
"date": "2017-09-13T15:23:12",
and the convention would be that each tool exporting ABCD data would:
- preserve the previous header
- add one "log" entry to the header
The benefits of all this are:
- clear header data, no longer mixed with other regular code-related data
- minimal trail/log of which tool touched and eventually transformed the data which is useful for tracing and documentation
Today we have header-level data in ScanCode data that is a tad ad-hoc. For instance:
We should normalize this and support having multiple tools providing some log that they touched the data.
Here is what I suggest: store these in a top level "header" attribute. This attribute would contain a list. Each list item would be an object.
With this in mind the new ScanCode output would look like this:
And with several tools having "touched" the data:
In this context these would be the only fields that are expected in a header item:
and the convention would be that each tool exporting ABCD data would:
The benefits of all this are: