aboutcode-org / scancode-server

This project is no longer maintained. Visit https://github.com/nexB/scancode.io/ instead for similar and current project
https://github.com/nexB/scancode.io/
19 stars 17 forks source link

Saving files information as the part of models #90

Open singh1114 opened 7 years ago

singh1114 commented 7 years ago

So, we can apply the following command into the terminal to get all the information about the files to be scanned before the real scan is applied. The results include every information about the file. For example, I applied this command in the root directory of this codebase.

scancode --info -f json-pp cc0-1.0.LICENSE

Result

{
  "scancode_notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
  "scancode_version": "2.0.1",
  "scancode_options": {
    "--info": true,
    "--license-score": 0,
    "--ignore": [],
    "--format": "json-pp"
  },
  "files_count": 1,
  "files": [
    {
      "path": "scancode-server/cc0-1.0.LICENSE",
      "type": "file",
      "name": "cc0-1.0.LICENSE",
      "base_name": "cc0-1.0",
      "extension": ".LICENSE",
      "date": "2017-08-19",
      "size": 6433,
      "sha1": "172444e7c137eb5cd3cae530aca0879c90f7fada",
      "md5": "57f047ea87f405486a94bc5a56ba7fcf",
      "files_count": null,
      "mime_type": "text/plain",
      "file_type": "ASCII text",
      "programming_language": "Text only",
      "is_binary": false,
      "is_text": true,
      "is_archive": false,
      "is_media": false,
      "is_source": true,
      "is_script": false,
      "scan_errors": []
    }
  ]
}

Well, the task is to store whole of these things into the models.

singh1114 commented 7 years ago

@pombredanne, Should we include a single JSONField to add the whole of that stuff or should we create another different model?

singh1114 commented 7 years ago

According to the discussion on official gitter channel we came to the conclusion that we are going to use the different fields for each attribute.