Skip to content

Configuration system: env var, INI config, priority resolution #4

Description

@kicka5h

Reliable stash path resolution with clear priority ordering and actionable errors.

Scope

  • `SNACK_STASH` env var takes highest priority and overrides config file
  • `~/.snackstashrc` stores named stashes in INI format (`[stash.]` sections)
  • Legacy sectionless `stash=` format read transparently, never written
  • `SnackConfig` class encapsulates all read/write logic
  • Every misconfiguration produces a specific, actionable error message

Acceptance criteria

  • Env var overrides config file in all commands
  • Active stash resolved correctly from `[config] active =` key
  • Legacy format read without error
  • Missing path, undefined active stash, and unconfigured state each produce distinct errors
  • Tests never write to real `~/.snackstashrc` (patched via `monkeypatch`)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions