Skip to content

bug: resolve relative scan paths #35

Description

@chiragpatil-lp

Summary

devclean scan --path . returns No items found even when the current
directory contains a recognized project and reclaimable artifacts. Passing the
same directory as an absolute path finds the expected items.

Environment

  • OS: macOS, arm64
  • DevClean: devclean version dev (commit none, built unknown)
  • Ecosystem: Python
  • Project markers: pyproject.toml, uv.lock

Reproduction

From a Python project containing .venv, .mypy_cache, .pytest_cache, and
.ruff_cache:

$ devclean scan --path . --eco python
No items found.

$ devclean scan --path /Users/lordpatil-air/onix/lnd-assistant --eco python --min-size 1MB
python 1 projects - 1.0 GB
.venv                     748.2 MB
.mypy_cache               268.5 MB

The relative-path command completed in effectively 0 seconds. The equivalent
absolute-path scan completed in 0.21 seconds and found the artifacts.

The same behavior reproduced one directory higher:

$ cd /Users/lordpatil-air/onix
$ devclean scan --path . --eco python
No items found.

An absolute path for that tree found Python artifacts normally.

Expected behavior

Resolve a relative --path against the current working directory before
project detection, scope checks, classification, and cleanup. Relative and
absolute paths that identify the same directory should produce equivalent scan
results.

Actual behavior

Relative --path values produce no results, which can falsely report a clean
tree. The same path in absolute form works.

Priority

Medium. The workaround is simple, but the current output is a silent false
negative and also affects confidence in cleanup targeting.

Level of effort

Small. Normalize the scan root once at the CLI or pipeline boundary and add
relative-path contract tests.

Passing criteria

  • Add an automated test that creates a temporary Python project with a marker
    and artifact, changes into the project, and confirms --path . finds it.
  • Assert that relative and absolute paths for the same temporary tree produce
    identical normalized result paths, counts, and total sizes.
  • Assert the same equivalence for both scan and clean --dry-run --yes.
  • Cover . and a nested relative path such as ../project.
  • Run go test ./... successfully.
  • Require no interactive input to verify the fix.

Sources

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions