Skip to content

Allow DefaultOff detectors to be used exclusively #1457

@lanni-energinet

Description

@lanni-energinet

I would like to use UvLock exclusively due to it being the detector with the best accuracy. As PipReport (and Pip) detectors seems to be highly inaccurate

PipReport - 8 dependencies found, 8 Explicitly Referenced
Pip - 9 dependencies found, 8 Explicitly Referenced
UvLock - 17 dependencies found, 2 Explicitly Referenced

Reproduction steps

Create the following file

# pyproject.toml

[project]
name = "hello_world"
version = "1.0.0"
description = "A simple Hello World Python project."
requires-python = ">=3.10"
dependencies = [
  "orjson>3.10.0",
  "Flask==3.1.1"
]

[dependency-groups]
dev = [
  "pytest"
]

Run the commands
uv sync
component-detection scan --SourceDirectory . --ManifestFile output.json --DetectorArgs UvLock=EnableIfDefaultOff

Expected

Successful manifest generation using UvLock as the only detector

Actual

An error occurred while executing the command
Microsoft.ComponentDetection.Orchestrator.Exceptions.InvalidDetectorFilterException: Detector 'UvLock' was not found
   at Microsoft.ComponentDetection.Orchestrator.Services.DetectorRestrictionService.ApplyRestrictions(DetectorRestrictions restrictions, IEnumerable`1 detectors)
   at Microsoft.ComponentDetection.Orchestrator.Services.ScanExecutionService.ExecuteScanAsync(ScanSettings settings)
   at Microsoft.ComponentDetection.Orchestrator.Commands.ScanCommand.ExecuteAsync(CommandContext context, ScanSettings settings)
   at Spectre.Console.Cli.CommandExecutor.Execute(CommandTree leaf, CommandTree tree, CommandContext context, ITypeResolver resolver, IConfiguration configuration) in /_/src/Spectre.Console.Cli/Internal/CommandExecutor.cs:line 166

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions