Skip to content

Check options in incoming ScanCode files #2 - #13

Merged
steven-esser merged 3 commits into
developfrom
2-check-scancode-options
Nov 1, 2017
Merged

steven-esser merged 3 commits into
developfrom
2-check-scancode-options

Conversation

@johnmhoran

Copy link
Copy Markdown
Member
  • Scan class get_options() method adds options from
    scancode_options field as dictionary to options attribute.

Signed-off-by: John M. Horan johnmhoran@gmail.com

  * Scan class 'get_options()' method adds options from
    'scancode_options' field as dictionary to 'options' attribute.

Signed-off-by: John M. Horan <johnmhoran@gmail.com>
@johnmhoran

Copy link
Copy Markdown
Member Author

@MaJuRG I see my commit failed one of the two Travis CI builds -- here's an excerpt from the build:

$ rake
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/home/travis/.rvm/gems/ruby-2.4.1@global/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/home/travis/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `eval'
/home/travis/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
The command "rake" exited with 1.
Done. Your build exited with 1.

Signed-off-by: John M. Horan <johnmhoran@gmail.com>

@steven-esser steven-esser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also add additional 'option' field checks for the Scan model unit tests on lines 238-265 in test_models.py

Comment thread tests/test_models.py Outdated

scan = models.Scan(test_file)

assert scan.options.get( '--license', None ) == None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably remove these spaces after the left and right parens: .get('--license', None)

Comment thread tests/test_models.py Outdated
assert scan.options['--license-score'] == 0
assert scan.options['--format'] == 'json'
assert scan.options.get( '--package', None ) == None
assert scan.options.get( '--copyright', None ) == None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ same here and here

Signed-off-by: John M. Horan <johnmhoran@gmail.com>
@steven-esser
steven-esser merged commit 34a3033 into develop Nov 1, 2017
@steven-esser
steven-esser deleted the 2-check-scancode-options branch November 1, 2017 19:58
@steven-esser

Copy link
Copy Markdown
Contributor

merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants