Skip to content

Commit 3b94bba

Browse files
committed
chore: add lint and test-file targets, clean up Makefile
Add lint target combining fmt-check and clippy-strict for quick pre-commit checks. Add test-file target for running all tests in a specific file (make test-file FILE=backup). Fix .PHONY to declare all targets. Remove dead targets: test-bench (no benches/ dir), test-pr-fix (ephemeral), integration-test (no scripts/ dir). Update CLAUDE.md to reference Makefile targets instead of raw cargo commands.
1 parent a83bd19 commit 3b94bba

2 files changed

Lines changed: 35 additions & 24 deletions

File tree

CLAUDE.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
# Git-Chain Development Guidelines
22

33
## Build, Test, Lint Commands
4-
- Build: `cargo build --release`
5-
- Run all tests: `cargo test`
6-
- Run a specific test: `cargo test test_name`
7-
- Run tests in a specific file: `cargo test --test backup`
8-
- Check for errors without running tests: `cargo check`
9-
- Format code: `cargo fmt`
10-
- Check for linting issues: `cargo clippy`
4+
5+
Use the Makefile for all development tasks. Run `make help` to see all available targets.
6+
7+
- Build: `make build` (or `make release` for release mode)
8+
- Run all tests: `make test` (or `make test-sequential` for single-threaded)
9+
- Run a specific test: `make test-specific TEST=test_name`
10+
- Run tests in a specific file: `make test-file FILE=backup`
11+
- Check for errors without building: `make check`
12+
- Format code: `make fmt`
13+
- Check formatting: `make fmt-check`
14+
- Lint (format check + strict clippy): `make lint`
15+
- Run clippy: `make clippy` (or `make clippy-strict` for CI-level strictness)
16+
- Full CI pipeline locally: `make ci-local`
17+
- Quick dev check (format + check): `make quick`
18+
- Clean build artifacts: `make clean`
1119

1220
## Code Style Guidelines
1321
- **Formatting**: Follow standard Rust style with 4-space indentation

Makefile

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# Git-Chain - Tool for Managing Git Branch Chains
22
# Development Makefile
33

4-
.PHONY: help test test-sequential test-pr check clippy fmt fmt-check clean doc doc-open build release install-deps ci-local all
4+
.PHONY: help build release install \
5+
test test-sequential test-pr test-merge test-rebase test-specific test-file \
6+
check clippy clippy-strict clippy-fix fmt fmt-check lint \
7+
doc doc-open clean install-deps \
8+
ci-local all quick dev \
9+
chain-init chain-list chain-status \
10+
debug-info watch \
11+
pre-release bump-version tag-version create-release \
12+
test-coverage
513

614
# Default target
715
.DEFAULT_GOAL := help
@@ -29,7 +37,7 @@ help: ## Show this help message
2937
@echo "$(BOLD)Examples:$(RESET)"
3038
@echo " make build # Build the project"
3139
@echo " make test # Run all tests"
32-
@echo " make check # Quick compilation check"
40+
@echo " make lint # Format check + strict clippy"
3341
@echo " make ci-local # Run full CI pipeline locally"
3442

3543
# === Building ===
@@ -73,6 +81,10 @@ test-specific: ## Run a specific test (use TEST=test_name)
7381
@echo "$(BOLD)$(GREEN)Running test: $(TEST)$(RESET)"
7482
@cargo test $(TEST) -- --nocapture
7583

84+
test-file: ## Run all tests in a file (use FILE=backup)
85+
@echo "$(BOLD)$(GREEN)Running tests in file: $(FILE)$(RESET)"
86+
@cargo test --test $(FILE)
87+
7688
# === Development ===
7789

7890
check: ## Quick compilation check
@@ -99,6 +111,12 @@ fmt-check: ## Check code formatting without changing files
99111
@echo "$(BOLD)$(MAGENTA)Checking code formatting...$(RESET)"
100112
@cargo fmt -- --check
101113

114+
lint: ## Run formatting check and strict clippy
115+
@echo "$(BOLD)$(YELLOW)Running lint checks...$(RESET)"
116+
@$(MAKE) fmt-check
117+
@$(MAKE) clippy-strict
118+
@echo "$(BOLD)$(GREEN)✓ Lint checks passed!$(RESET)"
119+
102120
# === Documentation ===
103121

104122
doc: ## Build documentation
@@ -259,18 +277,3 @@ test-coverage: ## Generate test coverage report (requires cargo-tarpaulin)
259277
@cargo tarpaulin --out Html
260278
@echo "$(BOLD)$(GREEN)✓ Coverage report generated in tarpaulin-report.html$(RESET)"
261279

262-
test-bench: ## Run benchmarks
263-
@echo "$(BOLD)$(CYAN)Running benchmarks...$(RESET)"
264-
@cargo bench
265-
266-
# === PR Testing ===
267-
268-
test-pr-fix: ## Test the PR draft fix
269-
@echo "$(BOLD)$(CYAN)Testing PR draft functionality fix...$(RESET)"
270-
@cargo test test_pr_command_with_draft_flag -- --nocapture
271-
272-
# === Integration Testing ===
273-
274-
integration-test: ## Run integration test in a temporary git repo
275-
@echo "$(BOLD)$(CYAN)Running integration test...$(RESET)"
276-
@./scripts/integration_test.sh || echo "$(YELLOW)Integration test script not found$(RESET)"

0 commit comments

Comments
 (0)