fossology / atarashi

Atarashi scans for license statements in open source software, focusing on text statistics. Designed to work stand-alone and with FOSSology.
http://fossology.github.io/atarashi
GNU General Public License v2.0
26 stars 23 forks source link

style(atarashii): formatting json output #56

Closed hastagAB closed 5 years ago

hastagAB commented 5 years ago

Result: as an extra word, in the beginning, disturbs the correct JSON architecture, which makes the output difficult to parse.

Old Format

Result: {
"file": "<file-path>",
"results": [
    {
        "description": "",
        "shortname": "OLDAP-2.6",
        "sim_score": 1,
        "sim_type": "dld"
    }
  ]  
}

New format

{
"file": "<file-path>",
"results": [
    {
        "description": "",
        "shortname": "OLDAP-2.6",
        "sim_score": 1,
        "sim_type": "dld"
    }
  ]  
}

Now it follows the correct JSON Schema

amanjain97 commented 5 years ago

Approved. Todo: Instead of printing, return the json and print wherever necessary.