Fix incorrect timing parameter passed to run_scanners#4783
Fix incorrect timing parameter passed to run_scanners#4783codewithfourtix wants to merge 1 commit intoaboutcode-org:developfrom
Conversation
The run_scanners call was passing 'timeout' (a float, default 120.0) as the 'timing' argument instead of the 'timing' boolean flag. This caused per-file scan timings to always be collected regardless of the --timing CLI option. Signed-off-by: codewithfourtix <codewithfourtix@gmail.com>
There was a problem hiding this comment.
Pull request overview
Fixes an incorrect argument being passed to run_scanners() from the main scan orchestration path (run_scan()), so that per-file scan timing collection correctly follows the --timing CLI flag rather than being implicitly enabled by the (truthy) timeout value.
Changes:
- Correct
run_scanners(..., timing=...)to use thetimingboolean instead oftimeout. - Restores expected CLI behavior where per-file scan timings are only collected when
--timingis enabled.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| codebase=codebase, | ||
| processes=processes, | ||
| timeout=timeout, | ||
| timing=timeout, | ||
| timing=timing, | ||
| quiet=quiet, |
There was a problem hiding this comment.
Consider adding a regression test that fails if --timing is not provided but per-file scan timings are still collected (e.g., assert scan_codebase(..., with_timing=...) receives False, or that outputs/resources do not include scan_timings unless --timing is set). This bug was caused by accidentally passing timeout into the timing parameter, and without a negative test it could regress silently again.
There was a problem hiding this comment.
Will address in a follow-up PR
Fix
timing=timeouttypo inrun_scannerscall inrun_scanThe
run_scannerscall was passingtimeout(a float, default 120.0) as thetimingargument instead of thetimingboolean flag. This caused per-file scan timings to always be collected regardless of the--timingCLI option.Tasks
Run [tests](https://scancode-toolkit.readthedocs.io/en/latest/contribute/contrib_dev.html#running-tests) locally to check for errors.