Add tools command for direct binary downloads from GitHub releases
Introduces a new 'tools' command that installs development tools (golangci-lint, gotestsum) by downloading pre-built binaries directly from GitHub releases instead of using 'go get -tool'. This prevents modifications to plugin go.mod files and improves build reliability. Features: - Cross-platform support (Windows, macOS, Linux) with automatic architecture detection - Version-specific binary naming with symlinks for easy access - Configurable installation directory via --bin-dir flag - Tar.gz archive extraction with binary validation - Updated Makefile integration to use downloaded binaries 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f8e3266029
commit
1b299de797
9 changed files with 596 additions and 102 deletions
|
@ -1,48 +1,88 @@
|
|||
run:
|
||||
timeout: 5m
|
||||
modules-download-mode: readonly
|
||||
|
||||
linters-settings:
|
||||
gofmt:
|
||||
simplify: true
|
||||
goimports:
|
||||
local-prefixes: {{.GoModule.Name}}
|
||||
govet:
|
||||
check-shadowing: true
|
||||
enable-all: true
|
||||
disable:
|
||||
- fieldalignment
|
||||
misspell:
|
||||
locale: US
|
||||
version: "2"
|
||||
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- bodyclose
|
||||
- errcheck
|
||||
- gocritic
|
||||
- gofmt
|
||||
- goimports
|
||||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- misspell
|
||||
- nakedret
|
||||
- revive
|
||||
- staticcheck
|
||||
- stylecheck
|
||||
- staticcheck # Now includes gosimple and stylecheck
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unused
|
||||
- whitespace
|
||||
- govet # Ensure this is included
|
||||
|
||||
settings:
|
||||
errcheck:
|
||||
# Add any errcheck settings here
|
||||
exclude-functions:
|
||||
- io.Copy(*bytes.Buffer)
|
||||
|
||||
gocritic:
|
||||
enabled-tags:
|
||||
- diagnostic
|
||||
- experimental
|
||||
- opinionated
|
||||
- performance
|
||||
- style
|
||||
|
||||
gosec:
|
||||
# Add gosec settings
|
||||
excludes:
|
||||
- G104 # Errors unhandled
|
||||
|
||||
staticcheck:
|
||||
# Configure staticcheck (includes gosimple/stylecheck checks)
|
||||
checks: ["all"]
|
||||
|
||||
revive:
|
||||
# Add revive rules
|
||||
rules:
|
||||
- name: exported
|
||||
disabled: false
|
||||
|
||||
exclusions:
|
||||
presets:
|
||||
- comments
|
||||
- std-error-handling
|
||||
- common-false-positives
|
||||
|
||||
rules:
|
||||
- path: '_test\.go'
|
||||
linters:
|
||||
- errcheck
|
||||
- gosec
|
||||
|
||||
formatters:
|
||||
enable:
|
||||
- gofmt
|
||||
- goimports
|
||||
|
||||
settings:
|
||||
gofmt:
|
||||
simplify: true
|
||||
|
||||
goimports:
|
||||
local-prefixes:
|
||||
- {{.LocalPrefix}}
|
||||
|
||||
output:
|
||||
formats:
|
||||
text:
|
||||
path: stdout
|
||||
colors: true
|
||||
print-linter-name: true
|
||||
|
||||
run:
|
||||
timeout: 5m
|
||||
tests: true
|
||||
|
||||
issues:
|
||||
exclude-rules:
|
||||
- path: server/configuration.go
|
||||
linters:
|
||||
- unused
|
||||
- path: _test\.go
|
||||
linters:
|
||||
- bodyclose
|
||||
- scopelint # https://github.com/kyoh86/scopelint/issues/4
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 0
|
||||
fix: false
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
# Testing and Quality Assurance
|
||||
# ====================================================================================
|
||||
|
||||
GOLANGCI_LINT_BINARY = ./build/bin/golangci-lint
|
||||
GOTESTSUM_BINARY = ./build/bin/gotestsum
|
||||
|
||||
## Install go tools
|
||||
install-go-tools:
|
||||
@echo Installing go tools
|
||||
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8
|
||||
$(GO) install gotest.tools/gotestsum@v1.7.0
|
||||
@echo "Installing development tools..."
|
||||
@pluginctl tools install --bin-dir ./build/bin
|
||||
|
||||
## Runs eslint and golangci-lint
|
||||
.PHONY: check-style
|
||||
|
@ -24,14 +26,14 @@ endif
|
|||
ifneq ($(HAS_SERVER),)
|
||||
@echo Running golangci-lint
|
||||
$(GO) vet ./...
|
||||
$(GOBIN)/golangci-lint run ./...
|
||||
$(GOLANGCI_LINT_BINARY) run ./...
|
||||
endif
|
||||
|
||||
## Runs any lints and unit tests defined for the server and webapp, if they exist.
|
||||
.PHONY: test
|
||||
test: apply webapp/node_modules install-go-tools
|
||||
ifneq ($(HAS_SERVER),)
|
||||
$(GOBIN)/gotestsum -- -v ./...
|
||||
$(GOTESTSUM_BINARY) -- -v ./...
|
||||
endif
|
||||
ifneq ($(HAS_WEBAPP),)
|
||||
cd webapp && $(NPM) run test;
|
||||
|
@ -42,7 +44,7 @@ endif
|
|||
.PHONY: test-ci
|
||||
test-ci: apply webapp/node_modules install-go-tools
|
||||
ifneq ($(HAS_SERVER),)
|
||||
$(GOBIN)/gotestsum --format standard-verbose --junitfile report.xml -- ./...
|
||||
$(GOTESTSUM_BINARY) --format standard-verbose --junitfile report.xml -- ./...
|
||||
endif
|
||||
ifneq ($(HAS_WEBAPP),)
|
||||
cd webapp && $(NPM) run test;
|
||||
|
|
Reference in a new issue