diff options
| author | Shulhan <ms@kilabit.info> | 2025-02-01 08:48:53 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2025-02-01 08:58:26 +0700 |
| commit | f04c347644db4dac89d8fe9e89a546b28aef1356 (patch) | |
| tree | c7c355c1e3847230648fccacab599877a5360776 | |
| parent | 5057dfdb75b851254987ac1237f84cd4d7f54a02 (diff) | |
| download | asciidoctor-go-f04c347644db4dac89d8fe9e89a546b28aef1356.tar.xz | |
make: replace external linters with internal command gocheck
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".
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | internal/cmd/gocheck/main.go | 17 |
2 files changed, 23 insertions, 4 deletions
@@ -1,24 +1,26 @@ ## SPDX-FileCopyrightText: 2020 M. Shulhan <ms@kilabit.info> ## SPDX-License-Identifier: GPL-3.0-or-later -.PHONY: all lint test-parser serve-doc - +.PHONY: all all: test lint +.PHONY: lint lint: - -fieldalignment ./... - -shadow ./... + go run ./internal/cmd/gocheck ./... go vet ./... +.PHONY: test test: go test -coverprofile=cover.out ./... go tool cover -html=cover.out -o cover.html +.PHONY: test-parser test-parser: asciidoctor --attribute stylesheet! \ --out-file=testdata/test.exp.html \ testdata/test.adoc go test -v -run=Open . +.PHONY: serve-doc serve-doc: ciigo -address=127.0.0.1:31904 serve _doc/ diff --git a/internal/cmd/gocheck/main.go b/internal/cmd/gocheck/main.go new file mode 100644 index 0000000..956e790 --- /dev/null +++ b/internal/cmd/gocheck/main.go @@ -0,0 +1,17 @@ +// SPDX-FileCopyrightText: 2024 M. Shulhan <ms@kilabit.info> +// +// SPDX-License-Identifier: GPL-3.0-or-later + +// Program gocheck implement go static analysis using [Analyzer] that are not +// included in the default go vet. +// See package [lib/goanalysis] for more information. +// +// [Analyzer]: https://pkg.go.dev/golang.org/x/tools/go/analysis#hdr-Analyzer +// [lib/goanalysis]: https://pkg.go.dev/git.sr.ht/~shulhan/pakakeh.go/lib/goanalysis/ +package main + +import "git.sr.ht/~shulhan/pakakeh.go/lib/goanalysis" + +func main() { + goanalysis.Check() +} |
