aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2025-02-01 09:43:49 +0700
committerShulhan <ms@kilabit.info>2025-02-01 09:43:49 +0700
commit3453ab4a27367677de29e98d190da7f752aed5ed (patch)
treed284370103d7cad5827d4d0ea1b8a6d5e2df1d44 /Makefile
parent3fbbf969aa646d07d26e8d3c0f9a01aff52491a3 (diff)
downloadciigo-3453ab4a27367677de29e98d190da7f752aed5ed.tar.xz
all: replace external linters with internal linter
The fieldalignment and shadow is linter from golang.org/x/tools. This linters actually have an API that can be combined into a program, which provided by package "pakakeh.go/lib/goanalysis".
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 10 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index d8e0006..14976ed 100644
--- a/Makefile
+++ b/Makefile
@@ -1,44 +1,48 @@
## SPDX-FileCopyrightText: 2019 Shulhan <ms@kilabit.info>
## SPDX-License-Identifier: GPL-3.0-or-later
-.PHONY: all lint test install build serve-doc
-
VERSION:=$(shell git describe --tags)
LDFLAGS:=-ldflags "-s -w -X 'git.sr.ht/~shulhan/ciigo.Version=$(VERSION)'"
DIR_BUILD:=_bin
+.PHONY: all
all: lint build test
+.PHONY: lint
lint:
- -fieldalignment ./...
- -shadow ./...
+ go run ./internal/cmd/gocheck ./...
go vet ./...
+.PHONY: test
test:
find ./testdata -name "*.html" -delete
CGO_ENABLED=1 go test -failfast -v -race -p=1 -coverprofile=cover.out ./...
go tool cover -html=cover.out -o cover.html
+.PHONY: install
install: build
mv _bin/ciigo $(GOBIN)
+.PHONY: run-example
run-example:
go run ./internal/cmd/ciigo-example
+.PHONY: build
build:
mkdir -p $(DIR_BUILD)
CGO_ENABLED=0 go build $(LDFLAGS) -o $(DIR_BUILD) ./cmd/...
+.PHONY: serve-doc
serve-doc:
go run ./cmd/ciigo -address=127.0.0.1:20757 serve _doc
-.PHONY: chroot-setup chroot-test
-
+.PHONY: chroot-setup
chroot-setup:
sudo mkdir -p /var/lib/machines/arch.test
sudo pacstrap -c /var/lib/machines/arch.test base-devel systemd go
sudo mkdir /var/lib/machines/arch.test/root/ciigo
+.PHONY: chroot-test
chroot-test:
sudo rsync -r . /var/lib/machines/arch.test/root/ciigo/
sudo systemd-nspawn --bind=/tmp \