Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.
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
94 changes: 56 additions & 38 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,66 @@
run:
# Default timeout is 1m, up to give more room
timeout: 4m
version: "2"
output:
formats:
tab:
path: stdout
colors: false
linters:
enable:
- asciicheck
- unused
- depguard
- gofumpt
- goimports
# - importas
- revive
- misspell
- stylecheck
- revive
- staticcheck
- tparallel
- unconvert
- unparam
- whitespace
linters-settings:
revive:
settings:
depguard:
rules:
main:
list-mode: lax
deny:
- pkg: gopkg.in/yaml
desc: use sigs.k8s.io/yaml
- pkg: github.com/hasura/go-graphql-client
desc: use github.com/Khan/genqlient[/graphql]
- pkg: github.com/shurcooL/graphql
desc: use github.com/Khan/genqlient[/graphql]
revive:
rules:
- name: dot-imports
arguments:
- allowedPackages:
- github.com/onsi/gomega
- github.com/onsi/ginkgo
- github.com/onsi/ginkgo/v2
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- name: dot-imports
arguments:
- allowedPackages:
- github.com/onsi/gomega
- github.com/onsi/ginkgo
- github.com/onsi/ginkgo/v2
goimports:
local-prefixes: github.com/opdev/productctl
depguard:
rules:
main:
list-mode: lax
deny:
- pkg: "gopkg.in/yaml"
desc: "use sigs.k8s.io/yaml"
- pkg: "github.com/hasura/go-graphql-client"
desc: "use github.com/Khan/genqlient[/graphql]"
- pkg: "github.com/shurcooL/graphql"
desc: "use github.com/Khan/genqlient[/graphql]"
issues:
exclude-rules:
- path: _test.go
linters:
- errcheck
output:
formats:
- format: tab
- linters:
- errcheck
path: _test.go
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofumpt
- goimports
settings:
goimports:
local-prefixes:
- github.com/opdev/productctl
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ install.gofumpt:

# golangci-lint
GOLANGCI_LINT = $(OUT_DIR)/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.63.4
GOLANGCI_LINT_VERSION ?= v2.1.6
install.golangci-lint:
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION))
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION))

# genqlient
GENQLIENT = $(OUT_DIR)/genqlient
Expand Down
6 changes: 1 addition & 5 deletions internal/catalogapi/catalogapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ func ApplyProduct(
) (*resource.ProductListingDeclaration, error) {
L := logger.FromContextOrDiscard(ctx)

updateListing := false

if declaration.Spec.HasID() {
updateListing = true
}
updateListing := declaration.Spec.HasID()

if !declaration.Spec.HasName() {
return nil, ErrMissingName
Expand Down