11LOG_LEVEL ?= info
22DEFAULT_DATA_DIR ?= /data_dir
33DEFAULT_SIMFILE_PATH ?= /data_dir/sim.json
4+ FMT_CMD = cargo fmt --verbose --all -- --color always --config-path=./rustfmt.toml
5+ CLIPPY_CMD = cargo clippy --all-features --all-targets --color always
46
57build-docker :
68 docker build -f docker/Dockerfile -t sim-ln .
@@ -10,11 +12,17 @@ mount-volume:
1012
1113help :
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
3644check-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
4048stable-output :
4149 @if [ -n " $$ (git status --porcelain)" ]; then \
@@ -52,3 +60,7 @@ install:
5260
5361dev-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