This guide covers everything you need to know for developing and contributing to bb-maid.
git clone https://github.com/simonneutert/bb-maid.git
cd bb-maidbb tasks # List available tasks
bb clean . # Clean current directory
bb clean-in 7d # Create cleanup file
bb test # Run tests# Install from project root
bbin install .
# Now test the actual bb-maid command
bb-maid clean --help
bb-maid clean-in 7d --gitignore
# After making changes, reinstall to test updates
bbin install . --force- Use Option A (
bbtasks) for quick iteration during development - Use Option B (
bbin install .) to test the actual user experience, including:- Command-line interface behavior
- Tab completion functionality
- Installation and upgrade workflows
The project uses a proper Babashka structure with:
- Source code in
src/simonneutert/bb_maid.clj - Tasks defined in
bb.ednthat call functions directly - Tests in
test/simonneutert/bb_maid_test.clj - Tab completion scripts in
completions/
bb-maid includes a test suite using clojure.test. To run the tests:
bb testOr run the test runner directly:
bb test-runner.cljThe test suite covers:
- Date parsing and validation
- Duration string parsing (
7d,30d, etc.) - Command-line option parsing
- Option combinations and defaults
- Symlink handling behavior (default: disabled, with --follow-links flag)
- Git integration features
- Gitignore file handling
Tests are located in test/simonneutert/bb_maid_test.clj. To add new tests:
- Add your test to the test namespace
- Run
bb testto verify
Example test:
(deftest my-new-test
(testing "Description of what you're testing"
(is (= expected-value (function-call args)))))Tab completion scripts are located in the completions/ directory:
_bb-maid- Zsh completionbb-maid.bash- Bash completionbb-maid.fish- Fish completion
When adding new commands or options, make sure to update both completion scripts.
To test tab completion during development:
Zsh:
# Temporarily load local completion
fpath=(./completions $fpath)
autoload -Uz compinit && compinitBash:
# Temporarily load local completion
source ./completions/bb-maid.bashFish:
# Temporarily load local completion
set -gx fish_complete_path ./completions $fish_complete_path