Skip to content

Commit

Permalink
Add is_media field to CodebaseResource #238
Browse files Browse the repository at this point in the history
    * Update test results

Signed-off-by: Jono Yang <[email protected]>
  • Loading branch information
JonoYang committed Aug 3, 2021
1 parent c94fc15 commit eac2426
Show file tree
Hide file tree
Showing 6 changed files with 376 additions and 369 deletions.
18 changes: 18 additions & 0 deletions scanpipe/migrations/0011_codebaseresource_is_media.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.6 on 2021-08-03 18:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('scanpipe', '0010_codebaseresource_is_key_file'),
]

operations = [
migrations.AddField(
model_name='codebaseresource',
name='is_media',
field=models.BooleanField(default=False),
),
]
1 change: 1 addition & 0 deletions scanpipe/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,7 @@ class Type(models.TextChoices):
is_text = models.BooleanField(default=False)
is_archive = models.BooleanField(default=False)
is_key_file = models.BooleanField(default=False)
is_media = models.BooleanField(default=False)

class Compliance(models.TextChoices):
OK = "ok"
Expand Down
1 change: 0 additions & 1 deletion scanpipe/pipes/scancode.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def get_resource_info(location):

# Missing fields on CodebaseResource model returned by `get_file_info`.
unsupported_fields = [
"is_media",
"is_source",
"is_script",
"date",
Expand Down
13 changes: 6 additions & 7 deletions scanpipe/tests/data/is-npm-1.0.0_scancode.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,30 @@
"headers": [
{
"tool_name": "scancode-toolkit",
"tool_version": "21.6.7",
"tool_version": "21.7.30",
"options": {
"input": [
"/Volumes/nexB/var/projects/wdsdadsadasd-bc9f8ade/codebase"
"/tmp/tmpkzp1f_pw/projects/analysis-03087122/codebase"
],
"--classify": true,
"--consolidate": true,
"--copyright": true,
"--email": true,
"--info": true,
"--is-license-text": true,
"--json-pp": "/Volumes/nexB/var/projects/wdsdadsadasd-bc9f8ade/output/scancode-2021-07-07-11-18-49.json",
"--json-pp": "/tmp/tmpkzp1f_pw/projects/analysis-03087122/output/scancode-2021-08-03-19-09-26.json",
"--license": true,
"--license-clarity-score": true,
"--license-text": true,
"--package": true,
"--processes": "4",
"--summary": true,
"--summary-key-files": true,
"--url": true
},
"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.",
"start_timestamp": "2021-07-07T111850.232385",
"end_timestamp": "2021-07-07T111856.279366",
"duration": 6.047006845474243,
"start_timestamp": "2021-08-03T190927.407466",
"end_timestamp": "2021-08-03T190932.182255",
"duration": 4.774801015853882,
"message": null,
"errors": [],
"extra_data": {
Expand Down
Loading

0 comments on commit eac2426

Please sign in to comment.