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
96 changes: 53 additions & 43 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,59 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# .golangci.yml

version: "2"
linters:
disable-all: true
default: none
enable:
- goimports
- revive
- importas
issues:
exclude-use-default: false
linters-settings:
importas:
no-unaliased: true
alias:
- pkg: "github.com/GoogleCloudPlatform/cloud-sql-proxy-operator/internal/api/v1alpha1"
alias: "cloudsqlapi"
revive:
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
# - name: exported
- name: if-return
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
- name: unused-parameter
- name: unreachable-code
- name: redefines-builtin-id
- name: range-val-in-closure
- name: range-val-address
- name: import-shadowing
run:
timeout: 5m
- revive
settings:
importas:
alias:
- pkg: github.com/GoogleCloudPlatform/cloud-sql-proxy-operator/internal/api/v1alpha1
alias: cloudsqlapi
no-unaliased: true
revive:
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: if-return
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
- name: empty-block
- name: superfluous-else
- name: unused-parameter
- name: unreachable-code
- name: redefines-builtin-id
- name: range-val-in-closure
- name: range-val-address
- name: import-shadowing
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot@sha256:c0f429e16b13e583da7e5a6ec20dd656d325d88e6819cafe0adb0828976529dc
FROM gcr.io/distroless/static:nonroot@sha256:627d6c5a23ad24e6bdff827f16c7b60e0289029b0c79e9f7ccd54ae3279fb45f

# For multi-arch builds, use automatic platform build arguments
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-operator
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot@sha256:c0f429e16b13e583da7e5a6ec20dd656d325d88e6819cafe0adb0828976529dc
FROM gcr.io/distroless/static:nonroot@sha256:627d6c5a23ad24e6bdff827f16c7b60e0289029b0c79e9f7ccd54ae3279fb45f

# For multi-arch builds, use automatic platform build arguments
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

## The version to use for the cert-manager operator
CERT_MANAGER_VERSION=v1.17.2# renovate datasource=github-tags depName=cert-manager/cert-manager
CERT_MANAGER_VERSION=v1.18.2# renovate datasource=github-tags depName=cert-manager/cert-manager

##@ General

Expand Down Expand Up @@ -155,7 +155,7 @@ build_push_docker: # Build docker image with the operator. set IMG env var befor
go_lint: golangci-lint # Run go lint tools, fail if unchecked errors
# Implements golang CI based on settings described here:
# See https://betterprogramming.pub/how-to-improve-code-quality-with-an-automatic-check-in-go-d18a5eb85f09
$(GOLANGCI_LINT) run --fix --fast ./...
$(GOLANGCI_LINT) run --fix ./...

.PHONY: tf_lint
tf_lint: terraform # Run terraform fmt to ensure terraform code is consistent
Expand Down Expand Up @@ -439,11 +439,11 @@ CRD_REF_DOCS ?= $(LOCALBIN)/crd-ref-docs
# additional whitespace will break the renovate regex rules.

KUBECTL_VERSION=v1.32.2# renovate datasource=github-tags depName=kubernetes/kubernetes
TERRAFORM_VERSION=v1.11.4# renovate datasource=github-tags depName=hashicorp/terraform
TERRAFORM_VERSION=v1.12.2# renovate datasource=github-tags depName=hashicorp/terraform

CONTROLLER_TOOLS_VERSION=v0.17.3# renovate datasource=go depName=sigs.k8s.io/controller-tools
CRD_REF_DOCS_VERSION=v0.1.0# renovate datasource=go depName=github.com/elastic/crd-ref-docs
GOLANGCI_LINT_VERSION=v1.64.8# renovate datasource=go depName=github.com/golangci/golangci-lint/cmd/golangci-lint
GOLANGCI_LINT_VERSION=v2.2.2# renovate datasource=go depName=github.com/golangci/golangci-lint/cmd/golangci-lint
GO_LICENSES_VERSION=v1.6.0# renovate datasource=go depName=github.com/google/go-licenses

KUSTOMIZE_VERSION=v5.6.0# don't manage with renovate, this repo has non-standard tags
Expand Down Expand Up @@ -498,7 +498,7 @@ $(TERRAFORM): $(LOCALBIN)
.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download controller-gen locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
test -s $@ || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
test -s $@ || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)

.PHONY: go-licenses
go-licenses: $(GO_LICENSES) ## Download controller-gen locally if necessary.
Expand Down
Loading
Loading