From 6f8f152a16647671116d1d261665f7f142aa014f Mon Sep 17 00:00:00 2001 From: Grigory Buteyko Date: Fri, 12 Jul 2024 01:06:23 +0300 Subject: [PATCH] make check target to check before pushing --- Makefile | 7 ++++++- README.md | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7f9e80c7..81376e89 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,6 @@ TL_BYTE_VERSIONS := ch_proxy.,ab. all: build build: - @echo "Building tlgen" @$(GO) build -ldflags "$(COMMON_LDFLAGS)" -buildvcs=false -o target/bin/tlgen ./cmd/tlgen tlo-bootstrap: build @@ -147,3 +146,9 @@ cpp_gen: build cpp: $(MAKE) cpp_gen $(MAKE) cpp_build + +# target should be as close as possible to github actions used to enable merge +.PHONY: check +check: build + @go test $(shell go list ./cmd/... ./internal/... ./pkg/... | grep -v /internal/tlcodegen/test/gen/) + @go run honnef.co/go/tools/cmd/staticcheck@v0.4.7 ./... # update version together with github actions \ No newline at end of file diff --git a/README.md b/README.md index f5131334..7a0747a6 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,16 @@ The TL format is characterized by compactness and high efficiency. TL is schema-driven format. Tool caled `tlgen` is used to generate structs/classes and (de)serialization methods. +## Running without installation + +You can run tool without installation. This is recommended way for most use cases. + +``` +go run github.com/vkcom/tl/cmd/tlgen@latest +``` + +For build scripts, you can pin particular version instead of `latest`. + ## Installation Install `tlgen` with the following command