Skip to content

Commit d6fff63

Browse files
committed
update inventory and license
1 parent 79e5bd8 commit d6fff63

File tree

6 files changed

+69
-74
lines changed

6 files changed

+69
-74
lines changed

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# goreleaser artifacts
22
/dist/
33

4+
# third-party dependencies
5+
/vendor/
6+
47
# code coverage and quality reports
58
/*.out
69

7-
# third-party dependencies
8-
/vendor/
10+
# sensitive data
11+
.env
12+
http-client.private.env.json

.golangci.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
linters:
22
fast: true
3-
fetch: >
4-
curl -s https://golangci-lint.run/usage/linters/ \
5-
| pup ':parent-of(#enabled-by-default-linters)' \
6-
| pup 'table td a json{}' \
7-
| jq -r '.[] | (.text + " " + .href)' \
8-
| column -t
93
enable:
10-
- deadcode # https://github.com/remyoudompheng/go-misc/tree/master/deadcode
11-
- errcheck # https://github.com/kisielk/errcheck
12-
- gosimple # https://github.com/dominikh/go-tools/tree/master/simple
13-
- govet # https://golang.org/cmd/vet/
14-
- ineffassign # https://github.com/gordonklaus/ineffassign
15-
- staticcheck # https://staticcheck.io/
16-
- structcheck # https://github.com/opennota/check
17-
- typecheck # -
18-
- unused # https://github.com/dominikh/go-tools/tree/master/unused
19-
- varcheck # https://github.com/opennota/check
4+
#d - deadcode # https://github.com/remyoudompheng/go-misc/tree/master/deadcode
5+
- errcheck # https://github.com/kisielk/errcheck
6+
- gosimple # https://github.com/dominikh/go-tools/tree/master/simple
7+
- govet # https://golang.org/cmd/vet/
8+
- ineffassign # https://github.com/gordonklaus/ineffassign
9+
- staticcheck # https://staticcheck.io/
10+
#d - structcheck # https://github.com/opennota/check
11+
- typecheck # -
12+
- unused # https://github.com/dominikh/go-tools/tree/master/unused
13+
#d - varcheck # https://github.com/opennota/check
2014

21-
- bodyclose # https://github.com/timakin/bodyclose
22-
- exhaustive # https://github.com/nishanths/exhaustive
23-
- exportloopref # https://github.com/kyoh86/exportloopref
24-
- gocritic # https://github.com/go-critic/go-critic
25-
- looppointer # https://github.com/kyoh86/looppointer
26-
- noctx # https://github.com/sonatard/noctx
15+
#! - bodyclose # https://github.com/timakin/bodyclose
16+
- exhaustive # https://github.com/nishanths/exhaustive
17+
- exportloopref # https://github.com/kyoh86/exportloopref
18+
- gocritic # https://github.com/go-critic/go-critic
19+
- noctx # https://github.com/sonatard/noctx
2720

21+
# - looppointer # https://github.com/kyoh86/looppointer
22+
23+
# - asasalint # https://github.com/alingse/asasalint
2824
# - asciicheck # https://github.com/tdakkota/asciicheck
2925
# - bidichk # https://github.com/breml/bidichk
3026
# - containedctx # https://github.com/sivchari/containedctx
@@ -38,7 +34,9 @@ linters:
3834
# - errchkjson # https://github.com/breml/errchkjson
3935
# - errname # https://github.com/Antonboom/errname
4036
# - errorlint # https://github.com/polyfloyd/go-errorlint
37+
# - execinquery # https://github.com/lufeee/execinquery
4138
# - exhaustivestruct # https://github.com/mbilski/exhaustivestruct
39+
# - exhaustruct # https://github.com/GaijinEntertainment/go-exhaustruct
4240
# - forbidigo # https://github.com/ashanbrown/forbidigo
4341
# - forcetypeassert # https://github.com/gostaticanalysis/forcetypeassert
4442
# - funlen # https://github.com/ultraware/funlen
@@ -77,6 +75,9 @@ linters:
7775
# - nilnil # https://github.com/Antonboom/nilnil
7876
# - nlreturn # https://github.com/ssgreg/nlreturn
7977
# - nolintlint # https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint/README.md
78+
# - nonamedreturns # https://github.com/firefart/nonamedreturns
79+
# - nosnakecase # https://github.com/sivchari/nosnakecase
80+
# - nosprintfhostport # https://github.com/stbenjam/no-sprintf-host-port
8081
# - paralleltest # https://github.com/kunwardeep/paralleltest
8182
# - prealloc # https://github.com/alexkohler/prealloc
8283
# - predeclared # https://github.com/nishanths/predeclared

.goreleaser.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ archives:
77
- LICENSE
88
format: tar.gz
99
name_template: "{{.Binary}}_{{.Version}}_{{.Os}}-{{.Arch}}"
10-
replacements:
11-
amd64: 64bit_x86
12-
arm64: 64bit_arm
13-
darwin: macOS
14-
linux: Linux
10+
rlcp: true
1511

1612
brews:
1713
- name: maintainer

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2022 OctoLab, https://www.octolab.org/ <[email protected]>
3+
Copyright (c) 2023 OctoLab, https://www.octolab.org/ <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.DEFAULT_GOAL = check
44
GIT_HOOKS = post-merge pre-commit pre-push
5-
GO_VERSIONS = 1.18
5+
GO_VERSIONS = 1.18 1.19
66

77
AT := @
88
ARCH := $(shell uname -m | tr '[:upper:]' '[:lower:]')
@@ -81,7 +81,7 @@ GOTEST ?= $(shell PATH=$(PATH) command -v testit)
8181
GOTESTFLAGS ?=
8282
GOTRACEBACK ?= all
8383
LOCAL ?= $(MODULE)
84-
MODULE ?= `go list -m $(GOFLAGS)`
84+
MODULE ?= `go list $(GOFLAGS)`
8585
PACKAGES ?= `go list $(GOFLAGS) ./...`
8686
PATHS ?= $(shell echo $(PACKAGES) | sed -e "s|$(MODULE)/||g" | sed -e "s|$(MODULE)|$(PWD)/*.go|g")
8787
TIMEOUT ?= 1s
@@ -172,11 +172,7 @@ go-docs:
172172
.PHONY: go-docs
173173

174174
go-fmt:
175-
$(AT) if command -v goimports >/dev/null; then \
176-
goimports -local $(LOCAL) -ungroup -w $(PATHS); \
177-
else \
178-
gofmt -s -w $(PATHS); \
179-
fi
175+
$(AT) goimports -local $(LOCAL) -w $(PATHS)
180176
.PHONY: go-fmt
181177

182178
go-generate:
@@ -188,11 +184,7 @@ go-pkg:
188184
.PHONY: go-pkg
189185

190186
lint:
191-
$(AT) if command -v golangci-lint >/dev/null; then \
192-
golangci-lint run ./...; \
193-
else \
194-
echo have no golangci-lint binary; \
195-
fi
187+
$(AT) golangci-lint run --enable looppointer ./...
196188
.PHONY: lint
197189

198190
test:
@@ -277,19 +269,11 @@ install-clean:
277269
.PHONY: install-clean
278270

279271
dist-check:
280-
$(AT) if command -v goreleaser >/dev/null; then \
281-
goreleaser --snapshot --skip-publish --rm-dist; \
282-
else \
283-
echo have no goreleaser binary; \
284-
fi
272+
$(AT) goreleaser --snapshot --skip-publish --rm-dist
285273
.PHONY: dist-check
286274

287275
dist-dump:
288-
$(AT) if command -v godownloader >/dev/null; then \
289-
godownloader .goreleaser.yml >bin/install; \
290-
else \
291-
echo have no godownloader binary; \
292-
fi
276+
$(AT) godownloader .goreleaser.yml >bin/install
293277
.PHONY: dist-dump
294278

295279
TOOLFLAGS ?= -mod=

Taskfile

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,41 @@
11
#!/usr/bin/env bash
22

3+
[ "${BASH_VERSINFO:-0}" -ge 4 ] || {
4+
echo "bash version 4 or higher is required" >&2
5+
exit 1
6+
}
7+
38
set -euo pipefail
49

5-
function test_example() {
6-
return 0
7-
}
10+
declare -A config
11+
config['dryrun']=false
812

9-
function tests() {
10-
for test in $(compgen -A function | grep 'test_'); do
11-
local result=()
12-
if $test >/dev/null 2>&1; then
13-
result+=(ok)
14-
else
15-
result+=(fail)
16-
fi
17-
result+=("${test}")
18-
result+=(todo:timer)
19-
echo "${result[@]}" | column -t
20-
done
13+
_() {
14+
if ${config['dryrun']}; then
15+
echo "${@}"
16+
return
17+
fi
18+
trap 'echo "${@}"' ERR
19+
"${@}"
2120
}
22-
23-
function help() {
24-
echo "$0 <task> <args>"
25-
echo "Tasks:"
26-
compgen -A function | grep -v '^__' | sort | cat -n
21+
@debug() { echo "${@}"; }
22+
@trace() { @debug "${@}" && "${@}"; }
23+
@error() { echo "${@}" >&2; }
24+
@fatal() { @error "${@}" && exit 1; }
25+
@usage() {
26+
cat - <<EOF
27+
Usage: $0 <task> <args>
28+
Tasks:
29+
EOF
30+
compgen -A function | grep -Ev '^(@|_)' | sort | cat -n
2731
}
2832

29-
__default() { help; }
33+
function @main() {
34+
if [[ "${1:-}" =~ ^--dry-run|-d$ ]]; then
35+
config['dryrun']=true
36+
shift
37+
fi
38+
"${@:-@usage}"
39+
}
3040

31-
"${@:-__default}"
41+
@main "${@}"

0 commit comments

Comments
 (0)