Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing --no-check-version cli option #4003

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/scancode/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ def scancode(
if check_version:
from scancode.outdated import check_scancode_version
outdated = check_scancode_version()
else:
outdated = None

# run proper
success, _results = run_scan(
Expand Down
6 changes: 6 additions & 0 deletions tests/scancode/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ def test_run_scan_includes_outdated_in_extra():
assert results['headers'][0]['extra_data']['OUTDATED'] == 'out of date'


def test_no_version_check_run_is_successful():
test_file = test_env.get_test_loc('single/iproute.c')
result_file = test_env.get_temp_file('json')
run_scan_click(['--no-check-version', test_file, '--json', result_file], expected_rc=0)


def test_usage_and_help_return_a_correct_script_name_on_all_platforms():
result = run_scan_click(['--help'])
assert 'Usage: scancode [OPTIONS]' in result.output
Expand Down