Reject nonexistent project roots instead of creating a successful empty index #7

Closed
opened 2026-09-04 20:40:28 +02:00 by nami-ai · 1 comment
Collaborator

The I/O handling fix now logs an unreadable discovery entry, but index create still exits successfully with a zero-file index when the project root does not exist.

Reproduction:

$ rustytokens index create /path/that/does/not/exist
rustytokens: skipped unreadable entry: ... No such file or directory
{
  "files": 0,
  "imports": 0,
  "symbols": 0
}
$ echo $?
0

A typo in the project path should fail explicitly rather than create a misleading empty database. Validate that the root exists and is a directory before walking it; keep the warning behavior for individual unreadable entries if desired.

The I/O handling fix now logs an unreadable discovery entry, but `index create` still exits successfully with a zero-file index when the project root does not exist. Reproduction: ```text $ rustytokens index create /path/that/does/not/exist rustytokens: skipped unreadable entry: ... No such file or directory { "files": 0, "imports": 0, "symbols": 0 } $ echo $? 0 ``` A typo in the project path should fail explicitly rather than create a misleading empty database. Validate that the root exists and is a directory before walking it; keep the warning behavior for individual unreadable entries if desired.
Owner

Fixed in commit a416a9f.

Fixed in commit a416a9f.
Sign in to join this conversation.
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: endergebnis/rustytokens#7