Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import _ "github.com/bool64/dev" // Include development helpers to project.
Add `Makefile` to your module with includes standard targets.

```Makefile
#GOLANGCI_LINT_VERSION := "v2.11.3" # Optional configuration to pinpoint golangci-lint version.
#GOLANGCI_LINT_VERSION := "v2.15.0" # Optional configuration to pinpoint golangci-lint version.

# The head of Makefile determines location of dev-go to include standard targets.
GO ?= go
Expand Down
2 changes: 1 addition & 1 deletion makefiles/base.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#GOLANGCI_LINT_VERSION := "v2.11.3" # Optional configuration to pinpoint golangci-lint version.
#GOLANGCI_LINT_VERSION := "v2.15.0" # Optional configuration to pinpoint golangci-lint version.

# The head of Makefile determines location of dev-go to include standard targets.
GO ?= go
Expand Down
1 change: 1 addition & 0 deletions scripts/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ run:
linters:
default: all
disable:
- exhaustruct_v5
- embeddedstructfieldcheck
- nilnil
- noinlineerr
Expand Down
15 changes: 13 additions & 2 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

[ -z "$GO" ] && GO=go
[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v2.11.3"
[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v2.15.0"

# detecting GOPATH and removing trailing "/" if any
GOPATH="$(go env GOPATH)"
Expand All @@ -13,7 +13,18 @@ GOPATH=${GOPATH%/}
# checking if golangci-lint is available
if ! command -v golangci-lint-"$GOLANGCI_LINT_VERSION" >/dev/null; then
echo "Installing golangci-lint $GOLANGCI_LINT_VERSION..."
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /tmp "$GOLANGCI_LINT_VERSION" && mv /tmp/golangci-lint "$GOPATH"/bin/golangci-lint-"$GOLANGCI_LINT_VERSION"
tmp=$(mktemp -d)
ver=${GOLANGCI_LINT_VERSION#v}
name=golangci-lint-$ver-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
url=https://github.com/golangci/golangci-lint/releases/download/$GOLANGCI_LINT_VERSION
curl -sSfL "$url/$name.tar.gz" -o "$tmp/$name.tar.gz" &&
curl -sSfL "$url/golangci-lint-$ver-checksums.txt" -o "$tmp/sums" &&
# anchored match: checksums also list "$name.tar.gz.sbom.json" since v2.15.0
want=$(grep -F " $name.tar.gz" "$tmp/sums" | grep -v sbom | awk '{print $1}') &&
[ "$(shasum -a 256 "$tmp/$name.tar.gz" | awk '{print $1}')" = "$want" ] &&
tar -xzf "$tmp/$name.tar.gz" -C "$tmp" &&
mv "$tmp/$name/golangci-lint" "$GOPATH"/bin/golangci-lint-"$GOLANGCI_LINT_VERSION"
rm -rf "$tmp"
fi

this_path=$(dirname "$0")
Expand Down
6 changes: 3 additions & 3 deletions templates/github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: stable
go-version: oldstable
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v9.2.0
uses: golangci/golangci-lint-action@v9.3.0
with:
version: v2.11.3
version: v2.15.0
Loading