Skip to content

Move registry cache to XDG cache directory - #3

Merged
polymorcodeus merged 2 commits into
mainfrom
move-cache
Sep 23, 2026
Merged

polymorcodeus merged 2 commits into
mainfrom
move-cache

Conversation

@polymorcodeus

Copy link
Copy Markdown
Owner

Summary

Adds XDG cache directory support for the machine-local registry and moves the default cache path from ~/.config/.todocache to $XDG_CACHE_HOME/todo/registry.json (falling back to ~/.cache/todo/registry.json). This aligns the registry with XDG base-directory conventions, since the file is rebuildable cache data rather than user configuration.

What's new

  • XDG cache directory support - internal/registry.DefaultPath now honors $XDG_CACHE_HOME before falling back to ~/.cache.
  • Cleaner cache layout - the registry file is now ~/.cache/todo/registry.json instead of a hidden dotfile under ~/.config.
  • Updated docs - README.md and CONTRIBUTING.md now describe the new location.

Behavior changes / guardrails

  • The old ~/.config/.todocache file is no longer read or written. Existing entries are orphaned, but the registry is rebuildable by running todo doctor --fix.
  • No automatic migration is provided because the cache can be reconstructed from disk.

Testing

  • Updated registry and CLI tests to use registry.json filenames in isolated temp dirs.
  • make check runs fmt, vet, lint, and tests; all green.

@polymorcodeus
polymorcodeus merged commit 4c9cea3 into main Sep 23, 2026
4 checks passed
@polymorcodeus
polymorcodeus deleted the move-cache branch September 23, 2026 18:46
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