Formats the whole backend to rustfmt defaults and fixes all 23 outstanding clippy warnings (collapsible ifs, clone-to-slice-ref, type-complexity, single-arm match, unnecessary is_none check), then wires cargo fmt --check and -D warnings into make lint so both stay enforced going forward. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TeyhRfMYjMditek6geDRoQ
46 lines
902 B
Makefile
46 lines
902 B
Makefile
.PHONY: all build build-fe build-be test test-fe test-be lint lint-fe lint-be run dev clean
|
|
|
|
all: build
|
|
|
|
# Build the webapp first so `webapp/dist` exists for the backend to serve,
|
|
# then build the Rust binary.
|
|
build: build-fe build-be
|
|
|
|
build-fe:
|
|
cd webapp && npm install && npm run build
|
|
|
|
build-be:
|
|
cargo build --release
|
|
|
|
test: test-be test-fe
|
|
|
|
test-be:
|
|
cargo test
|
|
|
|
test-fe:
|
|
cd webapp && npm run build
|
|
|
|
lint: lint-be lint-fe
|
|
|
|
lint-be:
|
|
cargo fmt -- --check
|
|
cargo clippy --all-targets -- -D warnings
|
|
|
|
lint-fe:
|
|
cd webapp && npm run lint
|
|
|
|
# Run the built binary, serving the webapp from webapp/dist.
|
|
run: build
|
|
./target/release/ottyl
|
|
|
|
# Frontend dev server with hot reload (proxy API calls to a separately
|
|
# running `cargo run` backend — see webapp/vite.config for the proxy setup).
|
|
dev:
|
|
cd webapp && npm run dev
|
|
|
|
clean:
|
|
cargo clean
|
|
rm -rf webapp/dist webapp/node_modules
|
|
rm profile.json.gz
|
|
|