Skip to content

Commit b20bf59

Browse files
committed
update dependencies
1 parent 5886edc commit b20bf59

File tree

13 files changed

+1138
-855
lines changed

13 files changed

+1138
-855
lines changed

.github/workflows/pr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
with:
2525
go-version-file: go.mod
2626
cache: false
27-
- run: echo "GOLANGCI_LINT_VERSION=$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint)" >> $GITHUB_ENV
28-
- uses: golangci/golangci-lint-action@v6
27+
- run: echo "GOLANGCI_LINT_VERSION=$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)" >> $GITHUB_ENV
28+
- uses: golangci/golangci-lint-action@v7
2929
with:
3030
version: ${{ env.GOLANGCI_LINT_VERSION }}
3131
only-new-issues: true

.github/workflows/push.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
with:
2222
go-version-file: go.mod
2323
cache: false
24-
- run: echo "GOLANGCI_LINT_VERSION=$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint)" >> $GITHUB_ENV
25-
- uses: golangci/golangci-lint-action@v6
24+
- run: echo "GOLANGCI_LINT_VERSION=$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)" >> $GITHUB_ENV
25+
- uses: golangci/golangci-lint-action@v7
2626
with:
2727
version: ${{ env.GOLANGCI_LINT_VERSION }}
2828

.golangci.yaml

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,64 @@
1+
version: "2"
2+
13
run:
24
modules-download-mode: readonly
35

4-
linters-settings:
5-
gofmt:
6-
simplify: true
7-
goimports:
8-
local-prefixes: github.com/axiomhq/axiom-syslog-proxy
9-
govet:
10-
enable:
11-
- shadow
12-
nolintlint:
13-
allow-unused: false
14-
require-explanation: true
15-
require-specific: true
16-
176
linters:
18-
disable-all: true
7+
default: none
198
enable:
209
- bodyclose
2110
- dogsled
2211
- dupl
2312
- errcheck
2413
- exhaustive
25-
- exportloopref
2614
- goconst
27-
- gofmt
28-
- goimports
2915
- gosec
30-
- gosimple
3116
- govet
3217
- ineffassign
3318
- misspell
3419
- nolintlint
3520
- prealloc
3621
- revive
3722
- staticcheck
38-
- stylecheck
39-
- typecheck
4023
- unconvert
4124
- unparam
4225
- unused
4326
- whitespace
27+
settings:
28+
govet:
29+
enable:
30+
- shadow
31+
nolintlint:
32+
require-explanation: true
33+
require-specific: true
34+
allow-unused: false
35+
exclusions:
36+
generated: lax
37+
presets:
38+
- comments
39+
- common-false-positives
40+
- legacy
41+
- std-error-handling
42+
paths:
43+
- .git
44+
- .github
45+
- .vscode
46+
- dist
4447

45-
issues:
46-
exclude-dirs:
47-
- .git
48-
- .github
49-
- .vscode
50-
- dist
48+
formatters:
49+
enable:
50+
- gofmt
51+
- goimports
52+
settings:
53+
gofmt:
54+
simplify: true
55+
goimports:
56+
local-prefixes:
57+
- github.com/axiomhq/axiom-syslog-proxy
58+
exclusions:
59+
generated: lax
60+
paths:
61+
- .git
62+
- .github
63+
- .vscode
64+
- dist

.goreleaser.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
version: 2
2+
13
project_name: axiom-syslog-proxy
24

35
builds:
@@ -77,21 +79,23 @@ archives:
7779
- <<: &archive_defaults
7880
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
7981
id: nix
80-
builds:
82+
ids:
8183
- darwin
8284
- linux
8385
- linux-no-pie
8486
wrap_in_directory: true
85-
format: tar.gz
87+
formats:
88+
- tar.gz
8689
files:
8790
- LICENSE
8891
- README.md
8992
- <<: *archive_defaults
9093
id: windows
91-
builds:
94+
ids:
9295
- windows
9396
wrap_in_directory: false
94-
format: zip
97+
formats:
98+
- zip
9599
files:
96100
- LICENSE
97101
- README.md
@@ -100,7 +104,7 @@ checksum:
100104
name_template: checksums.txt
101105

102106
snapshot:
103-
name_template: "{{ .Tag }}-next"
107+
version_template: "{{ .Tag }}-next"
104108

105109
changelog:
106110
use: github-native

Makefile

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# TOOLCHAIN
22
GO := CGO_ENABLED=0 go
33
CGO := CGO_ENABLED=1 go
4-
GOFMT := $(GO)fmt
54

65
# ENVIRONMENT
76
VERBOSE =
@@ -13,9 +12,6 @@ REVISION := $(shell git rev-parse --short HEAD)
1312
RELEASE := $(shell git describe --tags 2>/dev/null || git rev-parse --short HEAD)-dev
1413
USER := $(shell whoami)
1514

16-
# GO TOOLS
17-
GOTOOLS := $(shell cat tools.go | grep "_ \"" | awk '{ print $$2 }' | tr -d '"')
18-
1915
# MISC
2016
COVERPROFILE := coverage.out
2117
DIST_DIR := dist
@@ -45,8 +41,6 @@ ifdef VERBOSE
4541
endif
4642

4743
# FUNCTIONS
48-
# func go-run-tool(name)
49-
go-run-tool = $(CGO) run $(shell echo $(GOTOOLS) | tr ' ' '\n' | grep -w $1)
5044
# func go-list-pkg-sources(package)
5145
go-list-pkg-sources = $(GO) list -f '{{range .GoFiles}}{{$$.Dir}}/{{.}} {{end}}' $(1)
5246
# func go-pkg-sourcefiles(package)
@@ -58,7 +52,7 @@ all: dep fmt lint test build ## Run dep, fmt, lint, test and build
5852
.PHONY: build
5953
build: dep.stamp $(call go-pkg-sourcefiles, ./...) ## Build the binaries
6054
@echo ">> building binaries"
61-
@$(call go-run-tool, goreleaser) build $(GORELEASER_FLAGS)
55+
@$(GO) tool goreleaser build $(GORELEASER_FLAGS)
6256

6357
.PHONY: clean
6458
clean: ## Remove build and test artifacts
@@ -78,13 +72,7 @@ dep-clean: ## Remove obsolete dependencies
7872
.PHONY: dep-upgrade
7973
dep-upgrade: ## Upgrade all direct dependencies to their latest version
8074
@echo ">> upgrading dependencies"
81-
@$(GO) get -d $(shell $(GO) list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -m all)
82-
@make dep
83-
84-
.PHONY: dep-upgrade-tools
85-
dep-upgrade-tools: ## Upgrade all tool dependencies to their latest version
86-
@echo ">> upgrading tool dependencies"
87-
@$(GO) get -d $(GOTOOLS)
75+
@$(GO) get $(shell $(GO) list -f '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}' -m all)
8876
@make dep
8977

9078
.PHONY: dep
@@ -97,22 +85,22 @@ dep.stamp: $(GOMODDEPS)
9785
@touch $@
9886

9987
.PHONY: fmt
100-
fmt: ## Format and simplify the source code using `gofmt`
88+
fmt: ## Format and simplify the source code using `golangci-lint fmt`
10189
@echo ">> formatting code"
102-
@! $(GOFMT) -s -w $(shell find . -path -prune -o -name '*.go' -print) | grep '^'
90+
@$(GO) tool golangci-lint fmt
10391

10492
.PHONY: install
10593
install: $(GOPATH)/bin/axiom-syslog-proxy ## Install the binary into the $GOPATH/bin directory
10694

10795
.PHONY: lint
10896
lint: ## Lint the source code
10997
@echo ">> linting code"
110-
@$(call go-run-tool, golangci-lint) run
98+
@$(GO) tool golangci-lint run
11199

112100
.PHONY: test
113101
test: ## Run all tests. Run with VERBOSE=1 to get verbose test output ('-v' flag).
114102
@echo ">> running tests"
115-
@$(call go-run-tool, gotestsum) $(GOTESTSUM_FLAGS) -- $(GO_TEST_FLAGS) ./...
103+
@$(CGO) tool gotestsum $(GOTESTSUM_FLAGS) -- $(GO_TEST_FLAGS) ./...
116104

117105
.PHONY: help
118106
help:

0 commit comments

Comments
 (0)