From 3453ab4a27367677de29e98d190da7f752aed5ed Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 1 Feb 2025 09:43:49 +0700 Subject: 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". --- Makefile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d8e0006..14976ed 100644 --- a/Makefile +++ b/Makefile @@ -1,44 +1,48 @@ ## SPDX-FileCopyrightText: 2019 Shulhan ## 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 \ -- cgit v1.3