Skip to content

Commit 41409ed

Browse files
Ajit Pratap Singhclaude
authored andcommitted
fix: address review comments for Taskfile.yml
Fixes based on code review feedback: 1. Add error handling to lint:fix task - now checks if golangci-lint is installed before running, with helpful installation message 2. Add watchexec installation info to deps:tools - users are now informed about optional watchexec for 'task dev' watch mode 3. Add script existence checks: - hooks:install: validates scripts/install-hooks.sh exists - fuzz: validates scripts/run_fuzz_tests.sh exists - security:validate: validates scripts/validate-security-setup.sh exists 4. Add error handling for release tasks: - release:dry: checks for goreleaser installation - release:check: checks for goreleaser installation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 92fbebd commit 41409ed

1 file changed

Lines changed: 49 additions & 7 deletions

File tree

Taskfile.yml

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,14 @@ tasks:
155155
desc: Run fuzz tests (duration configurable via FUZZ_TIME, default 30s)
156156
cmds:
157157
- echo "Running fuzz tests for {{.FUZZ_TIME}}..."
158-
- ./scripts/run_fuzz_tests.sh
158+
- |
159+
if [ -f "./scripts/run_fuzz_tests.sh" ]; then
160+
./scripts/run_fuzz_tests.sh
161+
else
162+
echo "Error: scripts/run_fuzz_tests.sh not found"
163+
echo "You can run fuzz tests directly with: go test -fuzz=FuzzTokenizer -fuzztime={{.FUZZ_TIME}} ./pkg/sql/tokenizer"
164+
exit 1
165+
fi
159166
vars:
160167
FUZZ_TIME: '{{default "30s" .FUZZ_TIME}}'
161168

@@ -205,7 +212,13 @@ tasks:
205212
desc: Run golangci-lint with auto-fix
206213
cmds:
207214
- echo "Running golangci-lint with auto-fix..."
208-
- golangci-lint run --fix
215+
- |
216+
if command -v golangci-lint > /dev/null; then
217+
golangci-lint run --fix
218+
else
219+
echo "golangci-lint not installed. Run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest"
220+
exit 1
221+
fi
209222
210223
staticcheck:
211224
desc: Run staticcheck
@@ -249,7 +262,13 @@ tasks:
249262
security:validate:
250263
desc: Validate security setup
251264
cmds:
252-
- ./scripts/validate-security-setup.sh
265+
- |
266+
if [ -f "./scripts/validate-security-setup.sh" ]; then
267+
./scripts/validate-security-setup.sh
268+
else
269+
echo "Error: scripts/validate-security-setup.sh not found"
270+
exit 1
271+
fi
253272
254273
# =============================================================================
255274
# DOCUMENTATION
@@ -327,7 +346,12 @@ tasks:
327346
- go install golang.org/x/tools/cmd/godoc@latest
328347
- echo "Installing task runner..."
329348
- go install github.com/go-task/task/v3/cmd/task@latest
330-
- echo "All tools installed!"
349+
- echo ""
350+
- echo "All Go tools installed!"
351+
- echo ""
352+
- echo "Optional - For task dev watch mode, install watchexec"
353+
- echo " via Homebrew - brew install watchexec"
354+
- echo " via Cargo - cargo install watchexec-cli"
331355

332356
# =============================================================================
333357
# GIT HOOKS
@@ -336,7 +360,13 @@ tasks:
336360
desc: Install Git pre-commit hooks
337361
cmds:
338362
- echo "Installing Git hooks..."
339-
- ./scripts/install-hooks.sh
363+
- |
364+
if [ -f "./scripts/install-hooks.sh" ]; then
365+
./scripts/install-hooks.sh
366+
else
367+
echo "Error: scripts/install-hooks.sh not found"
368+
exit 1
369+
fi
340370
341371
# =============================================================================
342372
# CLEAN
@@ -386,12 +416,24 @@ tasks:
386416
desc: Dry-run release with goreleaser
387417
cmds:
388418
- echo "Running goreleaser dry-run..."
389-
- goreleaser release --snapshot --clean
419+
- |
420+
if command -v goreleaser > /dev/null; then
421+
goreleaser release --snapshot --clean
422+
else
423+
echo "goreleaser not installed. Install from: https://goreleaser.com/install/"
424+
exit 1
425+
fi
390426
391427
release:check:
392428
desc: Check goreleaser configuration
393429
cmds:
394-
- goreleaser check
430+
- |
431+
if command -v goreleaser > /dev/null; then
432+
goreleaser check
433+
else
434+
echo "goreleaser not installed. Install from: https://goreleaser.com/install/"
435+
exit 1
436+
fi
395437
396438
# =============================================================================
397439
# DEVELOPMENT HELPERS

0 commit comments

Comments
 (0)