From 0fd3a0134ed18ef205a2c4f38b45b4aeac56132f Mon Sep 17 00:00:00 2001 From: jitokim Date: Fri, 31 Jul 2026 08:48:44 +0900 Subject: [PATCH] chore(make): add `local` and `fmt-check` targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parity with oh-my-graph's `make local`: a one-command pre-push loop (fmt-check + vet + build + test) for the root module. `fmt-check` FAILS on unformatted code (the gate root-test.yml runs), unlike `fmt` which only lists. Checks only — it does not run the app, keeping fleetops's no-runner-creep identity; use `make test-all` to also cover tools/. Co-Authored-By: Claude Opus 4.8 Signed-off-by: jitokim --- Makefile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 65ef798..bdfbb02 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build install test fmt vet test-tools test-all +.PHONY: build install test fmt fmt-check vet test-tools test-all local # build produces a local ./fleetops binary (gitignored) — run it with # ./fleetops, or `make install` to put fleetops on your PATH instead. @@ -18,6 +18,12 @@ test: fmt: gofmt -l . +# fmt-check FAILS if any file is unformatted, unlike `fmt` (a lister that exits +# 0). This is the same gate root-test.yml runs (`test -z "$(gofmt -l .)"`); +# `local` uses it so a quick pre-push check catches what CI would reject. +fmt-check: + @test -z "$$(gofmt -l .)" || { echo "gofmt: files need formatting:"; gofmt -l .; exit 1; } + vet: go vet ./... @@ -45,3 +51,9 @@ test-tools: # test-all is what to run before pushing: the root module and every tools/ # module, the same set CI covers across its two workflows. test-all: test test-tools + +# local runs the root-module CI checks in one command — the quick pre-push +# loop, mirroring oh-my-graph's `make local`. Checks only; it does NOT run the +# app (keeping fleetops's no-runner-creep identity). Use `make test-all` before +# pushing to also cover the standalone tools/ modules. +local: fmt-check vet build test