Skip to content

Fix incorrect timing parameter passed to run_scanners#4783

Open
codewithfourtix wants to merge 1 commit intoaboutcode-org:developfrom
codewithfourtix:fix-timing-parameter-in-run-scan
Open

Fix incorrect timing parameter passed to run_scanners#4783
codewithfourtix wants to merge 1 commit intoaboutcode-org:developfrom
codewithfourtix:fix-timing-parameter-in-run-scan

Conversation

@codewithfourtix
Copy link

Fix timing=timeout typo in run_scanners call in run_scan

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.

Tasks

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>
Copilot AI review requested due to automatic review settings March 1, 2026 14:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 the timing boolean instead of timeout.
  • Restores expected CLI behavior where per-file scan timings are only collected when --timing is enabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 966 to 970
codebase=codebase,
processes=processes,
timeout=timeout,
timing=timeout,
timing=timing,
quiet=quiet,
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

Will address in a follow-up PR

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