Skip to content

Commit

Permalink
Bump golangci-lint from 1.56.2 to 1.62.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanGreene authored and tekton-robot committed Jan 8, 2025
1 parent 3a9de90 commit e9811b8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 14 deletions.
Empty file removed .errcheck.txt
Empty file.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
GO111MODULE="on" go install github.com/google/[email protected]
# Install GolangCI linter: https://github.com/golangci/golangci-lint/
GOLANGCI_VERSION=1.56.2
GOLANGCI_VERSION=1.62.2
curl -sL https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_VERSION}/golangci-lint-${GOLANGCI_VERSION}-linux-amd64.tar.gz | tar -C /usr/local/bin -xvzf - --strip-components=1 --wildcards "*/golangci-lint"
- name: Run tests
Expand Down
39 changes: 28 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Documentation: https://golangci-lint.run/usage/configuration/

linters-settings:
errcheck:
exclude: .errcheck.txt
gomodguard:
blocked:
modules:
- github.com/ghodss/yaml:
recommendations:
- sigs.k8s.io/yaml
depguard:
rules:
prevent_unmaintained_packages:
list-mode: lax # allow unless explicitely denied
files:
- $all
- "!$test"
allow:
- $gostd
deny:
- pkg: io/ioutil
desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
- pkg: github.com/ghodss/yaml
desc: "use sigs.k8s.io/yaml instead, to be consistent"
linters:
enable:
- bodyclose
Expand Down Expand Up @@ -42,6 +62,7 @@ linters:
- cyclop
- depguard
- dupl
- err113
- exhaustruct
- forcetypeassert
- funlen
Expand All @@ -52,19 +73,20 @@ linters:
- gocyclo
- godot
- godox
- goerr113
- gofumpt
- gomnd
- gomoddirectives
- iface
- ireturn
- lll
- mirror
- mnd
- nestif
- nlreturn
- nonamedreturns
- paralleltest
- prealloc
- predeclared
- recvcheck
- revive
- staticcheck
- stylecheck
Expand Down Expand Up @@ -98,17 +120,12 @@ output:
issues:
exclude-dirs:
- vendor
exclude-rules:
- path: _test\.go
linters:
- errcheck
- gosec
max-issues-per-linter: 0
max-same-issues: 0
include:
# Enable off-by-default rules for revive requiring that all exported elements have a properly formatted comment.
- EXC0012
- EXC0014
- EXC0012 # https://golangci-lint.run/usage/false-positives/#exc0012
- EXC0014 # https://golangci-lint.run/usage/false-positives/#exc0014
run:
issues-exit-code: 1
build-tags:
Expand Down
4 changes: 2 additions & 2 deletions pkg/utils/proxy.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020-2022 The Tekton Authors
Copyright 2020-2025 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down Expand Up @@ -31,7 +31,7 @@ func Proxy(request *http.Request, response http.ResponseWriter, url string, clie

req = req.WithContext(request.Context())

if request.Method == "POST" || request.Method == "PATCH" || request.Method == "PUT" || request.Method == "DELETE" {
if request.Method == http.MethodPost || request.Method == http.MethodPatch || request.Method == http.MethodPut || request.Method == http.MethodDelete {
req.Header.Set("Content-Type", request.Header.Get("Content-Type"))
}

Expand Down

0 comments on commit e9811b8

Please sign in to comment.