Dippy icon indicating copy to clipboard operation
Dippy copied to clipboard

Add example config and test harness

Open sbugalski opened this issue 8 months ago • 1 comments

Closes #124

Summary

  • examples/config — Annotated starter config with rules for Git, Docker, npm, MCP tools, shell redirects, and home directory protection. Includes warnings about the last-match-wins ordering footgun.
  • examples/test-config.sh — 45-test harness across 6 categories (MCP tools, redirects, system paths, home dir, commands, pipelines). Auto-detects dippy/dippy.exe, CI-friendly exit code.

Usage

cp examples/config ~/.dippy/config
bash examples/test-config.sh

Test plan

  • [ ] Copy examples/config to ~/.dippy/config
  • [ ] Run bash examples/test-config.sh — all 45 tests should pass
  • [ ] Verify test harness works on Linux/macOS (dippy) and Windows (dippy.exe)

sbugalski avatar Mar 24 '26 10:03 sbugalski

Thanks for this — and the inline comments are exactly what make an example config readable, so I don't want to lose them. The catch is they don't currently work, and that's our bug, not yours: Dippy doesn't strip mid-line # comments from rule lines, so allow uv run pytest # test runner keeps the comment in the pattern and never matches uv run pytest. I checked and it's every directive type (commands, redirects, mcp, alias, even set), and it fails silently. Configuration.md documents allow git status # Inline comment as supported, so you followed the docs and Dippy let you down. I've written it up as #153.

So this PR is blocked on #153 rather than on anything you need to change — once the parser honors inline comments, your config works as written. Two smaller things to flag for when it's unblocked:

  • Ordering: allow rm -rf /**/__pycache__ near the top gets overridden by ask rm -rf lower down (last-match-wins), so that one asks rather than allows. Your own header warns about exactly this footgun — just needs reordering.
  • The test harness: it would've caught the dead rules, which is a good argument for running the example's expectations in CI (a small pytest that loads examples/config and asserts a few decisions) rather than a standalone script that has to be run by hand.

Genuinely useful PR — it turned up a real bug on our end. Holding it until #153 lands.

ldayton avatar Jun 08 '26 14:06 ldayton