Skip to content

Conversation

tony
Copy link
Member

@tony tony commented Oct 18, 2025

Summary

Motivation

  • vcspull import --scan treated ~/study/c, ~/study/c/, and /home/user/study/c
    as three unrelated sections, so existing repositories were re-offered during
    scans.
  • Formatter output could keep redundant workspace-root sections, allowing the
    duplication to persist after a format pass.
  • CLI help, docs, and tests still mixed the legacy "base dir" terminology with
    the newer workspace-root language.

What changed

  • Added canonicalization helpers that resolve workspace roots to an absolute
    pathlib.Path, collapse to a single label, and memoize the mapping for reuse
    across importer and formatter flows.
  • Updated vcspull import to normalize both config files and newly discovered
    directories before merging, ensuring repeated scans do not present the same
    repositories twice.
  • Extended vcspull fmt to call the same normalization routine prior to
    sorting/writing, so the formatter also removes duplicate sections and writes
    consistent labels.
  • Replaced the --base-dir-key/--dir CLI options and internal parameters with
    --workspace-root, and refreshed CLI help, README, and docs to match.
  • Expanded CLI test matrices (import+fmt) with NamedTuple-driven parametrization
    covering all combinations of tilde, absolute, trailing-slash, and relative
    workspace-root inputs.

Testing

  • uv run ruff check . --fix --show-fixes
  • uv run ruff format .
  • uv run mypy
  • uv run py.test
  • uv run vcspull import --scan ~/study/c
  • uv run vcspull fmt --write --all

Copy link

codecov bot commented Oct 18, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.26%. Comparing base (06af066) to head (7f1c938).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
src/vcspull/config.py 78.00% 7 Missing and 4 partials ⚠️
src/vcspull/cli/fmt.py 60.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #470      +/-   ##
==========================================
- Coverage   80.23%   79.26%   -0.97%     
==========================================
  Files           9        9              
  Lines         597      656      +59     
  Branches      134      147      +13     
==========================================
+ Hits          479      520      +41     
- Misses         67       78      +11     
- Partials       51       58       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tony tony force-pushed the import-duplicate-bug branch 4 times, most recently from ed7ef78 to 039d898 Compare October 18, 2025 19:24
@tony tony force-pushed the import-duplicate-bug branch from 039d898 to 2f64357 Compare October 18, 2025 19:26
tony added a commit that referenced this pull request Oct 18, 2025
@tony tony force-pushed the import-duplicate-bug branch from 547abd9 to 538c860 Compare October 18, 2025 21:29
@tony tony force-pushed the import-duplicate-bug branch from 538c860 to 7f1c938 Compare October 18, 2025 21:34
@tony tony merged commit 530a43f into master Oct 18, 2025
10 checks passed
@tony tony deleted the import-duplicate-bug branch October 18, 2025 21:39
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.

1 participant