Skip to content

Commit 8a1ca7e

Browse files
committed
sim-ln/enhance: Makefile add format, FMT_CMD, CLIPPY_CMD
1 parent 5044fb7 commit 8a1ca7e

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

Makefile

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
LOG_LEVEL ?= info
22
DEFAULT_DATA_DIR ?= /data_dir
33
DEFAULT_SIMFILE_PATH ?= /data_dir/sim.json
4+
FMT_CMD = cargo fmt --verbose --all -- --color always
5+
CLIPPY_CMD = cargo clippy --all-features --all-targets --color always
46

57
build-docker:
68
docker build -f docker/Dockerfile -t sim-ln .
@@ -10,11 +12,17 @@ mount-volume:
1012

1113
help:
1214
@echo "Makefile commands:"
13-
@echo "build-docker Builds the Docker image."
14-
@echo "mount-volume Mounts the specified volume."
15-
@echo "run Runs the Docker container."
16-
@echo "run-interactive Runs the Docker container in interactive mode."
17-
@echo "stop Stops the Docker container."
15+
@echo "build-docker Builds the Docker image."
16+
@echo "mount-volume Mounts the specified volume."
17+
@echo "run-docker Runs the Docker container in detached mode."
18+
@echo "run-interactive Runs the Docker container in interactive mode."
19+
@echo "stop-docker Stops the Docker container."
20+
@echo "check Runs code formatting and linting checks."
21+
@echo "check-code Runs code formatting and linting without stability check."
22+
@echo "format Fixes both formatting and linting issues in one go."
23+
@echo "stable-output Checks for unstaged/uncommitted changes after checks."
24+
@echo "install Installs the simulation CLI."
25+
@echo "dev-install Installs the simulation CLI with development features."
1826
@echo ""
1927
@echo "Variables:"
2028
@echo "SIMFILE_PATH Path to the sim.json file."
@@ -34,8 +42,8 @@ stop-docker:
3442
docker stop sim-ln
3543

3644
check-code:
37-
cargo fmt --verbose --check --all -- --color always
38-
cargo clippy --all-features --all-targets --color always -- -D warnings
45+
$(FMT_CMD) --check
46+
$(CLIPPY_CMD) -- -D warnings
3947

4048
stable-output:
4149
@if [ -n "$$(git status --porcelain)" ]; then \
@@ -52,3 +60,7 @@ install:
5260

5361
dev-install:
5462
RUSTFLAGS="--cfg tokio_unstable" cargo install --locked --path sim-cli --features dev
63+
64+
format:
65+
$(FMT_CMD)
66+
$(CLIPPY_CMD) --fix --allow-dirty --allow-staged -- -D warnings

0 commit comments

Comments
 (0)