synheart-sensor-agent 0.2.0

Privacy-first PC background sensor for behavioral research
Documentation
# ======================================================================
# Synheart-Sensor-Agent : Project Automation Makefile
# Use 'make <target>' to run common development tasks.
# ======================================================================

# CI commands (match .github/workflows/ci.yml exactly)
FMT_CMD := fmt --all
FMT_CHECK_CMD := fmt --all -- --check
CLIPPY_CMD := clippy --all-targets --all-features -- -D warnings

.PHONY: all fmt fmt-check lint test check clean doc build build-release run ci

# Default target: runs the comprehensive check
all: check

#* CODE QUALITY TARGETS

# Formats all Rust code files in the project
fmt:
	@echo "Running rustfmt across all files..."
	cargo $(FMT_CMD)

# Checks formatting without modifying files (for CI)
fmt-check:
	@echo "Checking code formatting..."
	cargo $(FMT_CHECK_CMD)

# Runs the linter (Clippy) and enforces a strict, zero-warning policy
lint:
	@echo "Running cargo clippy with zero-warning policy..."
	cargo $(CLIPPY_CMD)

# Runs all tests (unit, integration, and doc tests)
test:
	@echo "Running all tests..."
	cargo test --all-features

# Comprehensive check: runs formatting check, linting, and testing
check: fmt-check lint test
	@echo "✅ All code quality checks passed."

#* BUILD TARGETS

# Build with default features (minimal)
build:
	@echo "Building with default features..."
	cargo build

# Build with all features enabled (flux, gateway, server)
build-all:
	@echo "Building with all features..."
	cargo build --all-features

# Build in release mode with all features
build-release:
	@echo "Building in release mode with all features..."
	cargo build --release --all-features

# Build with server feature only
build-server:
	@echo "Building with server feature..."
	cargo build --features server

# Build with flux feature only
build-flux:
	@echo "Building with flux feature..."
	cargo build --features flux

#* RUN TARGETS

# Run the sensor agent with default features
run:
	@echo "Running synheart-sensor..."
	cargo run

# Run with server feature enabled
run-server:
	@echo "Running synheart-sensor with server feature..."
	cargo run --features server

# Run with all features enabled
run-all:
	@echo "Running synheart-sensor with all features..."
	cargo run --all-features

# Run the capture demo example
demo:
	@echo "Running capture demo..."
	cargo run --example capture_demo

#* UTILITY TARGETS

# Cleans build artifacts
clean:
	@echo "Cleaning build artifacts..."
	cargo clean

# Generate documentation for the project with no dependencies
doc:
	@echo "Generating documentation..."
	cargo doc --no-deps --all-features

# Show help for the sensor CLI
help-cli:
	@echo "Showing CLI help..."
	cargo run -- --help

#* CI TARGETS (mirrors GitHub Actions workflow exactly)

# CI check - identical to what runs in .github/workflows/ci.yml
ci: fmt-check lint test
	@echo "✅ CI checks passed."