Skip to content

Commit

Permalink
Merge pull request #23614 from Luap99/lint-1.60.1
Browse files Browse the repository at this point in the history
update golangci-lint to 1.60.1
  • Loading branch information
openshift-merge-bot[bot] authored Aug 19, 2024
2 parents 5f069d8 + 84a8531 commit 84126fd
Show file tree
Hide file tree
Showing 317 changed files with 601 additions and 361 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ BUILDTAGS += ${EXTRA_BUILDTAGS}
# N/B: This value is managed by Renovate, manual changes are
# possible, as long as they don't disturb the formatting
# (i.e. DO NOT ADD A 'v' prefix!)
GOLANGCI_LINT_VERSION := 1.59.1
GOLANGCI_LINT_VERSION := 1.60.1
PYTHON ?= $(shell command -v python3 python|head -n1)
PKG_MANAGER ?= $(shell command -v dnf yum|head -n1)
# ~/.local/bin is not in PATH on all systems
Expand Down
2 changes: 2 additions & 0 deletions cmd/podman-testing/create.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package main

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/podman-testing/data.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package main

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/podman-testing/layer.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package main

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/podman-testing/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package main

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/podman-testing/remove.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package main

import (
Expand Down
1 change: 0 additions & 1 deletion cmd/podman-testing/store_supported.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux && !remote
// +build linux,!remote

package main

Expand Down
16 changes: 0 additions & 16 deletions cmd/podman-testing/store_unsupported.go

This file was deleted.

4 changes: 0 additions & 4 deletions cmd/podman/containers/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/containers/common/pkg/completion"
"github.com/containers/podman/v5/cmd/podman/common"
"github.com/containers/podman/v5/cmd/podman/registry"
"github.com/containers/podman/v5/pkg/api/handlers"
"github.com/containers/podman/v5/pkg/domain/entities"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -105,9 +104,6 @@ func commit(cmd *cobra.Command, args []string) error {
if !commitOptions.Quiet {
commitOptions.Writer = os.Stderr
}
if len(commitOptions.Changes) > 0 {
commitOptions.Changes = handlers.DecodeChanges(commitOptions.Changes)
}
if len(configFile) > 0 {
cfg, err := os.ReadFile(configFile)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/containers/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func CreateInit(c *cobra.Command, vals entities.ContainerCreateOptions, isInfra
vals.ShmSizeSystemd = c.Flag("shm-size-systemd").Value.String()
}
if (c.Flag("dns").Changed || c.Flag("dns-option").Changed || c.Flag("dns-search").Changed) && vals.Net != nil && (vals.Net.Network.NSMode == specgen.NoNetwork || vals.Net.Network.IsContainer()) {
return vals, fmt.Errorf("conflicting options: dns and the network mode: " + string(vals.Net.Network.NSMode))
return vals, errors.New("conflicting options: dns and the network mode: " + string(vals.Net.Network.NSMode))
}
noHosts, err := c.Flags().GetBool("no-hosts")
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions hack/golangci-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ BUILD_TAGS_TUNNEL="$BUILD_TAGS_DEFAULT,remote"
BUILD_TAGS_REMOTE="remote,containers_image_openpgp"

SKIP_DIRS_ABI=""
SKIP_DIRS_TUNNEL="pkg/api,pkg/domain/infra/abi,internal/domain/infra/abi"
SKIP_DIRS_REMOTE="libpod/events,pkg/api,pkg/domain/infra/abi,internal/domain/infra/abi,pkg/machine/qemu,pkg/trust,test"
SKIP_DIRS_TUNNEL=""
SKIP_DIRS_REMOTE="libpod/events,pkg/machine/qemu,pkg/machine/wsl,test"

declare -a to_lint
to_lint=(ABI TUNNEL REMOTE)
to_lint=(ABI TUNNEL)

# Special-case, for Darwin and Windows only "remote" linting is possible and required.
if [[ "$GOOS" == "windows" ]] || [[ "$GOOS" == "darwin" ]]; then
Expand Down
2 changes: 2 additions & 0 deletions internal/domain/entities/engine_testing.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package entities

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/domain/entities/testing.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package entities

type CreateStorageLayerOptions struct {
Expand Down
2 changes: 2 additions & 0 deletions internal/domain/infra/abi/testing.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package abi

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/domain/infra/abi/testing_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package abi

import "github.com/containers/podman/v5/internal/domain/entities"
Expand Down
25 changes: 0 additions & 25 deletions internal/domain/infra/runtime_tunnel.go

This file was deleted.

2 changes: 2 additions & 0 deletions internal/domain/infra/tunnel/testing.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package tunnel

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/domain/infra/tunnel/testing_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package tunnel

import "github.com/containers/podman/v5/internal/domain/entities"
Expand Down
2 changes: 1 addition & 1 deletion libpod/container_top_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ func (c *Container) execPSinContainer(args []string) ([]string, error) {
if logrus.GetLevel() >= logrus.DebugLevel {
// If we're running in debug mode or higher, we might want to have a
// look at stderr which includes debug logs from conmon.
logrus.Debugf(errBuf.String())
logrus.Debug(errBuf.String())
}

if err := <-outErrChan; err != nil {
Expand Down
2 changes: 2 additions & 0 deletions libpod/events/logfile_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build linux || freebsd

package events

import (
Expand Down
3 changes: 2 additions & 1 deletion pkg/annotations/validate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package annotations

import (
"errors"
"fmt"
"regexp"
"strings"
Expand Down Expand Up @@ -41,7 +42,7 @@ func isDNS1123Subdomain(value string) error {
}

if !dns1123SubdomainRegexp.MatchString(value) {
return fmt.Errorf(regexErrorMsg(dns1123SubdomainErrorMsg, dns1123SubdomainFmt, "example.com"))
return errors.New(regexErrorMsg(dns1123SubdomainErrorMsg, dns1123SubdomainFmt, "example.com"))
}

return nil
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/auth.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/changes.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_archive.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_attach.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_create.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_export.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_logs.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_pause.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_prune.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_restart.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_start.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_stats_freebsd.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_stats_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_stop.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_top.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/containers_unpause.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/events.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/exec.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
4 changes: 3 additions & 1 deletion pkg/api/handlers/compat/images.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down Expand Up @@ -137,7 +139,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
options.Author = query.Author
options.Pause = query.Pause
options.Squash = query.Squash
options.Changes = handlers.DecodeChanges(query.Changes)
options.Changes = util.DecodeChanges(query.Changes)
if r.Body != nil {
defer r.Body.Close()
if options.CommitOptions.OverrideConfig, err = abi.DecodeOverrideConfig(r.Body); err != nil {
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/images_build.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/images_history.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/images_prune.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/images_push.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/images_remove.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/images_save.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/images_search.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/images_tag.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/info.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/networks.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/ping.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/handlers/compat/resize.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !remote

package compat

import (
Expand Down
Loading

0 comments on commit 84126fd

Please sign in to comment.