Skip to content

feat: add clear command to clear indices#181

Merged
stephantul merged 4 commits into
mainfrom
add-clear-command
Jun 4, 2026
Merged

feat: add clear command to clear indices#181
stephantul merged 4 commits into
mainfrom
add-clear-command

Conversation

@stephantul
Copy link
Copy Markdown
Contributor

This PR adds a semble clear command. clear takes a single argument: "all", "savings" or "index". "all" clears everything, "savings" clears the savings jsonl, "index" only clears saved indexes. Indexes are only cleared if they are complete, and all files are present.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/semble/cli.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Jun 4, 2026

Confidence Score: 4/5

Safe to merge; the deletion guards (SHA-256 regex + PersistencePath.non_existing()) prevent unintended data loss, and the change is purely additive.

The core logic is straightforward and well-protected. The two style issues (glob breadth and type shadowing the built-in) do not affect correctness. The gap in the index-deletion tests — where no assertion checks that the directories are actually gone from disk — leaves a small blind spot but does not indicate a current defect.

The index-clearing test cases in tests/test_cli.py would benefit from an on-disk existence check to match the rigour of the savings tests.

Reviews (1): Last reviewed commit: "feat: add clear command to clear indices" | Re-trigger Greptile

Comment thread src/semble/cli.py Outdated
Comment thread src/semble/cli.py Outdated
Comment thread tests/test_cli.py Outdated
Copy link
Copy Markdown
Member

@Pringled Pringled left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Few small suggestions to reduce number of tests but not blocking

Comment thread tests/test_cli.py Outdated
Comment thread tests/test_cli.py Outdated
Comment thread tests/test_cli.py Outdated
@stephantul stephantul merged commit 77001a7 into main Jun 4, 2026
15 checks passed
@stephantul stephantul deleted the add-clear-command branch June 4, 2026 19:38
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.

2 participants