From aa41b251e41c35136498683ae39e31ee960a803d Mon Sep 17 00:00:00 2001 From: Manoj Gowda Date: Thu, 27 Aug 2026 19:47:28 +0530 Subject: [PATCH] Declare an explicit default for the --only-findings flag click 8.5.0 (released 2026-08-26) exposes Sentinel.UNSET as the .default of options declared without an explicit default, and that sentinel is truthy. run_scan() collects raw option defaults, so every function-API scan silently enabled the only-findings output filter and dropped findingless resources: the directory entry disappeared from results and test_can_call_run_scan_as_a_function fails with 'assert 1 == 2' in all the *_latest_from_pip CI jobs since then. --only-findings was the only option in the codebase declared without an explicit default. Declaring default=False restores the previous behavior on click 8.5 and is a no-op on older versions. Signed-off-by: Manoj Gowda --- src/scancode/plugin_only_findings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scancode/plugin_only_findings.py b/src/scancode/plugin_only_findings.py index 38e03f5bfd..df45f9e1fc 100644 --- a/src/scancode/plugin_only_findings.py +++ b/src/scancode/plugin_only_findings.py @@ -21,6 +21,7 @@ class OnlyFindings(OutputFilterPlugin): options = [ PluggableCommandLineOption(('--only-findings',), is_flag=True, + default=False, help='Only return files or directories with findings for the ' 'requested scans. Files and directories without findings are ' 'omitted (file information is not treated as findings).',