1
1
LOG_LEVEL ?= info
2
2
DEFAULT_DATA_DIR ?= /data_dir
3
3
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
4
6
5
7
build-docker :
6
8
docker build -f docker/Dockerfile -t sim-ln .
@@ -10,11 +12,17 @@ mount-volume:
10
12
11
13
help :
12
14
@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."
18
26
@echo " "
19
27
@echo " Variables:"
20
28
@echo " SIMFILE_PATH Path to the sim.json file."
@@ -34,8 +42,8 @@ stop-docker:
34
42
docker stop sim-ln
35
43
36
44
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
39
47
40
48
stable-output :
41
49
@if [ -n " $$ (git status --porcelain)" ]; then \
@@ -52,3 +60,7 @@ install:
52
60
53
61
dev-install :
54
62
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