@@ -177,7 +177,7 @@ fix-trailing-whitespace: ## Remove trailing whitespaces from all files
177177 -not -path " ./website/static/api-docs/*" \
178178 -not -path " ./website/.docusaurus/*" \
179179 -not -path " ./.git/*" \
180- -exec sh -c ' echo "Processing: $$1"; sed -i"" -e "s/[[:space:]]*$$//" "$$1"' _ {} \; && \
180+ -exec sh -c ' echo "Processing: $$1"; sed -i"" "s/[[:space:]]*$$//" "$$1"' _ {} \; && \
181181 echo " Trailing whitespaces removed."
182182
183183.PHONY : check-trailing-whitespace
@@ -287,6 +287,42 @@ setup-wasm: ## Setup the WebAssembly toolchain, using nightly
287287 rustup target add wasm32-unknown-unknown --toolchain ${NIGHTLY_RUST_VERSION} -$$ TARGET; \
288288 cargo install wasm-bindgen-cli --version ${WASM_BINDGEN_CLI_VERSION}
289289
290+ .PHONY : setup-taplo
291+ setup-taplo : # # Install taplo TOML formatter if not present
292+ @if ! command -v taplo & > /dev/null; then \
293+ echo " Installing taplo..." ; \
294+ if command -v cargo-binstall & > /dev/null; then \
295+ cargo binstall -y taplo-cli; \
296+ else \
297+ TAPLO_VERSION=" 0.9.3" ; \
298+ OS=$$(uname -s | tr '[:upper:]' '[:lower:]' ) ; \
299+ ARCH=$$(uname -m ) ; \
300+ case " $$ OS" in \
301+ darwin) OS=" darwin" ;; \
302+ linux) OS=" linux" ;; \
303+ * ) echo " Unsupported OS: $$ OS" ; exit 1 ;; \
304+ esac ; \
305+ case " $$ ARCH" in \
306+ x86_64) ARCH=" x86_64" ;; \
307+ arm64| aarch64) ARCH=" aarch64" ;; \
308+ * ) echo " Unsupported architecture: $$ ARCH" ; exit 1 ;; \
309+ esac ; \
310+ TAPLO_URL=" https://github.com/tamasfe/taplo/releases/download/$$ {TAPLO_VERSION}/taplo-full-$$ {OS}-$$ {ARCH}.gz" ; \
311+ echo " Downloading taplo from $$ {TAPLO_URL}..." ; \
312+ curl -L " $$ {TAPLO_URL}" | gunzip > /tmp/taplo; \
313+ chmod +x /tmp/taplo; \
314+ if [ -d " $$ HOME/.cargo/bin" ]; then \
315+ mv /tmp/taplo " $$ HOME/.cargo/bin/taplo" ; \
316+ echo " Installed taplo to ~/.cargo/bin/taplo" ; \
317+ else \
318+ echo " Warning: ~/.cargo/bin not found, taplo installed to /tmp/taplo" ; \
319+ echo " Please add ~/.cargo/bin to PATH or move /tmp/taplo manually" ; \
320+ fi ; \
321+ fi ; \
322+ else \
323+ echo " taplo is already installed" ; \
324+ fi
325+
290326.PHONY : test
291327test : # # Run tests
292328 cargo test
@@ -391,6 +427,11 @@ docker-build-heartbeats-processor: ## Build heartbeats processor Docker image
391427 docker build -t $(DOCKER_ORG ) /mina-rust-heartbeats-processor:$(GIT_COMMIT ) \
392428 tools/heartbeats-processor/
393429
430+ .PHONY : heartbeats-db-init
431+ heartbeats-db-init : # # Initialize the heartbeats database with schema
432+ @sqlite3 /tmp/heartbeats.db < tools/heartbeats-processor/schema.sql
433+ @echo " Database initialized at /tmp/heartbeats.db"
434+
394435.PHONY : docker-build-light
395436docker-build-light : # # Build light Docker image
396437 docker build -t $(DOCKER_ORG ) /mina-rust-light:$(GIT_COMMIT ) \
0 commit comments