Skip to content

Commit

Permalink
Merge pull request #4003 from alexzurbonsen/fix-no-check-version-bug
Browse files Browse the repository at this point in the history
Fix failing --no-check-version cli option
  • Loading branch information
AyanSinhaMahapatra authored Dec 5, 2024
2 parents 65e1c2d + 706c0f7 commit c40476a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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

0 comments on commit c40476a

Please sign in to comment.