Skip to content

Commit

Permalink
chore(make): add clean, fmt, lint (#46)
Browse files Browse the repository at this point in the history
Add more `make` commands to clean, format and lint code easier.
  • Loading branch information
0xurb authored Oct 16, 2024
1 parent 232c42a commit bc8c87e
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,67 @@ define docker_build_push
--provenance=false \
--push
endef

##@ Other

.PHONY: clean
clean: ## Perform a `cargo` clean and remove the binary directory.
cargo clean
rm -rf $(BIN_DIR)

fmt:
cargo +nightly fmt

lint-odyssey:
cargo +nightly clippy \
--workspace \
--bin "odyssey" \
--lib \
--tests \
--benches \
--features "$(FEATURES)" \
-- -D warnings

lint-other-targets:
cargo +nightly clippy \
--workspace \
--lib \
--tests \
--benches \
--all-features \
-- -D warnings

lint:
make fmt && \
make lint-odyssey && \
make lint-other-targets

fix-lint-odyssey:
cargo +nightly clippy \
--workspace \
--bin "odyssey" \
--lib \
--tests \
--benches \
--features "$(FEATURES)" \
--fix \
--allow-staged \
--allow-dirty \
-- -D warnings

fix-lint-other-targets:
cargo +nightly clippy \
--workspace \
--lib \
--tests \
--benches \
--all-features \
--fix \
--allow-staged \
--allow-dirty \
-- -D warnings

fix-lint:
make fix-lint-odyssey && \
make fix-lint-other-targets && \
make fmt

0 comments on commit bc8c87e

Please sign in to comment.