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
4 changes: 2 additions & 2 deletions .custom-gcl.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: v2.10.1 # should be in sync with script/setup-custom-gcl.sh
version: v2.10.1 # this is the version of golangci-lint
plugins:
- module: "github.com/google/go-github/v84/tools/extraneousnew"
path: ./tools/extraneous-new
path: ./tools/extraneousnew
- module: "github.com/google/go-github/v84/tools/fmtpercentv"
path: ./tools/fmtpercentv
- module: "github.com/google/go-github/v84/tools/sliceofpointers"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
with:
go-version: stable
cache-dependency-path: "**/go.sum"
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: |
bin/golangci-lint
bin/custom-gcl
key: ${{ runner.os }}-${{ runner.arch }}-tools-${{ hashFiles('.custom-gcl.yml', 'tools/**/go.mod', 'tools/**/go.sum', 'tools/**/*.go') }}
- run: script/lint.sh
env:
CHECK_GITHUB_OPENAPI: 1
Expand Down
16 changes: 12 additions & 4 deletions script/setup-custom-gcl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@

set -e

# should be in sync with .custom-gcl.yml
GOLANGCI_LINT_VERSION="v2.10.1"
ROOT_DIR="$(cd -- "$(dirname -- "$0")/.." > /dev/null 2>&1 && pwd -P)"
CUSTOM_GCL_CONFIG="$ROOT_DIR/.custom-gcl.yml"
GOLANGCI_LINT_VERSION="$(
sed -n 's/^[[:space:]]*version:[[:space:]]*//p' "$CUSTOM_GCL_CONFIG" \
| sed '1{s/[[:space:]]*#.*$//;s/^"//;s/"$//;s/[[:space:]]*$//;p;};d'
)"

# should in sync with fmt.sh and lint.sh
BIN="$(pwd -P)"/bin
if [ -z "$GOLANGCI_LINT_VERSION" ]; then
echo "Error: could not determine golangci-lint version from $CUSTOM_GCL_CONFIG" >&2
exit 1
fi

BIN="$ROOT_DIR/bin"

mkdir -p "$BIN"

Expand Down
File renamed without changes.
File renamed without changes.
Loading