Skip to content

Commit aa41b25

Browse files
committed
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 <manojgowdabs18@gmail.com>
1 parent 3c532f0 commit aa41b25

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/scancode/plugin_only_findings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class OnlyFindings(OutputFilterPlugin):
2121

2222
options = [
2323
PluggableCommandLineOption(('--only-findings',), is_flag=True,
24+
default=False,
2425
help='Only return files or directories with findings for the '
2526
'requested scans. Files and directories without findings are '
2627
'omitted (file information is not treated as findings).',

0 commit comments

Comments
 (0)