octomation / makefiles Goto Github PK
View Code? Open in Web Editor NEW๐ Set of useful Makefiles.
Home Page: https://makefiles.octolab.org/
License: MIT License
๐ Set of useful Makefiles.
Home Page: https://makefiles.octolab.org/
License: MIT License
Line 38 in cb9b711
because it's already present in generate
because it's not necessary anymore
.PHONY: test-with-coverage
test-with-coverage:
@go test -cover -covermode atomic -coverprofile c.out -race -timeout $(TIMEOUT) $(PACKAGES) | column -t | sort -r
.PHONY: test-with-coverage-report
test-with-coverage-report: test-with-coverage
@go tool cover -html c.out
remove test-with-coverage-profile
it tries to update all deps include transitive
need to replace -u
to @latest
which only validate compilation
$ make todo
./paas/rpcprotocol/rater.go:51: TODO:legacy
./bin/darwin/x86_64/golangci-lint:13933:SkipNow
./bin/darwin/x86_64/golangci-lint:14403:SkipNow
./bin/darwin/x86_64/golangci-lint:17188: TODO: pushState with updated state and read it on page load,
./bin/darwin/x86_64/golangci-lint:17333: TODO: Implement smarter auto-zoom using the viewBox attribute
./bin/darwin/x86_64/golangci-lint:17372: TODO: scale the graph with the viewBox attribute.
./components/makefiles/vendor.mk:20: TODO:.*|SkipNow' . || true
for pre-filling the local cache or to compute the answers for a Go module proxy
$ make test-verbose
test-integration:
@go test \
-cover \
-covermode atomic \
-race \
-tags=integration \
-coverprofile integration.out \
./... | column -t | sort -r
.PHONY: test-integration
test-integration-report: test-with-coverage
@go tool cover -html integration.out
.PHONY: test-integration-report
$ ls | grep .mk | maintainer makefile build
GOTESTFLAGS ?=
verbose:
$(eval GOTESTFLAGS := $(GOTESTFLAGS) -v)
@echo > /dev/null
.PHONY: verbose
test:
@test $(GOTESTFLAGS) ./...
.PHONY: test
$ make verbose test
now it has a problem with fish and old mac terminal
if gotest present use it, otherwise fallback to go test
AT := @
verbose:
$(eval AT :=)
@echo > /dev/null
.PHONY: verbose
candidates:
from tests
| column -t | sort -r
see https://travis-ci.com/github/kamilsk/breaker/jobs/474205925
$ if [[ $TRAVIS_GO_VERSION == 1.15* ]]; then
make test-with-coverage
else
make test
fi
/bin/bash: line 1: -cover: command not found
Makefile:156: recipe for target 'test-with-coverage' failed
make: *** [test-with-coverage] Error 127
The command "if [[ $TRAVIS_GO_VERSION == 1.15* ]]; then
make test-with-coverage
else
make test
fi
" exited with 2.
add target git-verify|git-check
deps-check:
@go mod verify
good example
ops: MAIN = ./cmd/control/main.go
ops: BINARY = $(BINPATH)/ops
ops: build
.PHONY: ops
make service client
do the same deps-update, but for tools
now tools are not provided by makefile
cause I need docs on top-level
at go-service:
$ make update
...
$ git diff tools/go.mod
- github.com/golangci/golangci-lint v1.37.1
+ github.com/golangci/golangci-lint v1.38.0
but expected
$ make update
...
$ git diff tools/go.mod
- github.com/golangci/golangci-lint v1.37.1
- github.com/grpc-ecosystem/grpc-gateway/v2 v2.2.0
+ github.com/golangci/golangci-lint v1.38.0
+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.3.0
- google.golang.org/protobuf v1.25.0
+ google.golang.org/protobuf v1.25.1-0.20201208041424-160c7477e0e8
so, why it's happening as above?
$ git config core.autocrlf input
remove git hooks
in some cases, I don't want to use tools/etc, but I use a template and it's not ok to adapt it locally.
it will be great to use check before enabling some targets:
ifeq (, wildcard(tools/*))
target with stub
else
valid target
endif
candidates:
when I published [email protected] the cache of https://pkg.go.dev/github.com/kamilsk/breaker was a stale long time
if dir contains only dirs and they are empty, or the dir is empty, then remove it
GO111MODULE ?= on
GOFLAGS ?= -mod=vendor
GOPRIVATE ?= go.octolab.org
GOPROXY ?= direct
LOCAL ?= $(MODULE)
MODULE ?= `GO111MODULE=on go list -m $(GOFLAGS)`
PACKAGES ?= `GO111MODULE=on go list $(GOFLAGS) ./...
PATHS ?= $(shell echo $(PACKAGES) | sed -e "s|$(MODULE)/||g" | sed -e "s|$(MODULE)|$(PWD)/*.go|g")
TIMEOUT ?= 10s
and remove GO111MODULE=on
-include
allows to skip if file not found
GOTEST := $(GOTEST) --colored
-> GOTEST := $(GOTEST) go --colored
$ make in-go-1.11 test
go list -u -f '{{if (and (not (or .Main .Indirect)) .Update)}}{{.Path}}: {{.Version}} -> {{.Update.Version}}{{end}}' -m all 2> /dev/null
replace go mod -edit
+ go mod download
by go get -d $$package/...@latest
verify: deps-check generate git-check|git-verify lint test
go get -u ./...
SHELL ?= /bin/bash -euo pipefail
- pipefail is lost@go test -run ^Fake$$ -tags $(GOTAGS) ./... | grep -v 'no tests to run'
works unproperly if go test run on single-package module without errorssee https://github.com/lyft/protoc-gen-star#testing
for example, make quick
is good to have
$ make update
flag provided but not defined: -mod
usage: go get [-d] [-t] [-u] [-v] [-insecure] [build flags] [packages]
Run 'go help get' for details.
make: *** [update] Error 2
$ make deps-update
go get .@latest: can't request explicit version of path in main module
make: *** [deps-update] Error 1
if SHELL is not defined then export PATH didn't work properly.
steps to reproduce:
print:
which <file in path>
https://www.gnu.org/software/make/manual/make.html#Variables_002fRecursion
https://stackoverflow.com/questions/8941110/how-i-could-add-dir-to-path-in-makefile
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.