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: 0 additions & 4 deletions .github/zizmor.yml

This file was deleted.

64 changes: 31 additions & 33 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ run:
- exclude_graphdriver_devicemapper

linters:
default: none
enable:
- bodyclose
- depguard
Expand All @@ -26,22 +27,6 @@ linters:
- unused
- whitespace
settings:
gocritic:
disabled-checks:
- "ifElseChain"
- "assignOp"
- "appendAssign"
- "singleCaseSwitch"
importas:
alias:
- pkg: "github.com/opencontainers/image-spec/specs-go/v1"
alias: "ocispecs"
- pkg: "github.com/opencontainers/go-digest"
alias: "digest"
govet:
enable:
- nilness
- unusedwrite
depguard:
rules:
main:
Expand All @@ -62,19 +47,35 @@ linters:
- pattern: ^ctx\.Err(# use context\.Cause instead)?$
- pattern: ^fmt\.Errorf(# use errors\.Errorf instead)?$
- pattern: ^platforms\.DefaultString(# use platforms\.Format(platforms\.DefaultSpec()) instead\.)?$
gocritic:
disabled-checks:
- "ifElseChain"
- "assignOp"
- "appendAssign"
- "singleCaseSwitch"
gosec:
excludes:
- G115
- G204
- G402
- G115
config:
G306: "0644"
govet:
enable:
- nilness
- unusedwrite
importas:
alias:
- pkg: github.com/opencontainers/image-spec/specs-go/v1
alias: ocispecs
- pkg: github.com/opencontainers/go-digest
alias: digest
testifylint:
disable:
- "empty"
- "bool-compare"
- "len"
- "negative-positive"
- empty
- bool-compare
- len
- negative-positive
exclusions:
generated: lax
presets:
Expand All @@ -83,28 +84,25 @@ linters:
- legacy
- std-error-handling
rules:
-
linters:
- linters:
- revive
text: stutters
-
linters:
- linters:
- revive
text: var-naming
- linters:
- revive
text: empty-block
-
linters:
- linters:
- revive
text: superfluous-else
-
linters:
- linters:
- revive
text: unused-parameter
-
linters:
- linters:
- revive
text: redefines-builtin-id
-
linters:
- linters:
- revive
text: if-return
paths:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.25"
ARG GO_VERSION="1.26"
ARG ALPINE_VERSION="3.23"
ARG XX_VERSION="1.9.0"

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/crazy-max/diun/v4

go 1.25.5
go 1.26.0

require (
dario.cat/mergo v1.0.2
Expand Down
2 changes: 1 addition & 1 deletion hack/gen.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.25"
ARG GO_VERSION="1.26"
ARG PROTOC_VERSION="3.17.3"

# protoc is dynamically linked to glibc so can't use alpine base
Expand Down
2 changes: 1 addition & 1 deletion hack/govulncheck.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.25"
ARG GO_VERSION="1.26"
ARG ALPINE_VERSION="3.23"

ARG GOVULNCHECK_VERSION="v1.1.4"
Expand Down
4 changes: 2 additions & 2 deletions hack/lint.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.25"
ARG GO_VERSION="1.26"
ARG XX_VERSION="1.9.0"
ARG ALPINE_VERSION="3.23"
ARG GOLANGCI_LINT_VERSION="v2.1.6"
ARG GOLANGCI_LINT_VERSION="v2.11.4"
ARG GOLANGCI_FROM_SOURCE="true"

FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
Expand Down
2 changes: 1 addition & 1 deletion hack/vendor.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.25"
ARG GO_VERSION="1.26"
ARG ALPINE_VERSION="3.23"
ARG GOMOD_OUTDATED_VERSION="v0.8.0"

Expand Down
6 changes: 3 additions & 3 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ for <code>{{ .Entry.Manifest.Platform }}</code> platform.
TemplateTitle: model.NotifDefaultTemplateTitle,
TemplateBody: model.NotifDefaultTemplateBody,
},
Pushover: &model.NotifPushover{
Pushover: &model.NotifPushover{ //nolint:gosec // fixture values are test data.
Token: "uQiRzpo4DXghDmr9QzzfQu27cmVRsG",
Recipient: "gznej3rKEVAvPUxu9vvNnqpmZpokzF",
Timeout: utl.NewDuration(10 * time.Second),
Expand Down Expand Up @@ -232,7 +232,7 @@ for <code>{{ .Entry.Manifest.Platform }}</code> platform.
InsecureTLS: utl.NewFalse(),
Timeout: utl.NewDuration(0),
},
model.RegOpt{
model.RegOpt{ //nolint:gosec // fixture paths are test data.
Name: "docker.io/crazymax",
Selector: model.RegOptSelectorImage,
UsernameFile: "./fixtures/run_secrets_username",
Expand Down Expand Up @@ -325,7 +325,7 @@ func TestLoadEnv(t *testing.T) {
Watch: (&model.Watch{}).GetDefaults(),
Defaults: (&model.Defaults{}).GetDefaults(),
RegOpts: model.RegOpts{
model.RegOpt{
model.RegOpt{ //nolint:gosec // fixture paths are test data.
Name: "docker.io",
Selector: model.RegOptSelectorImage,
UsernameFile: "./fixtures/run_secrets_username",
Expand Down
3 changes: 2 additions & 1 deletion internal/grpc/client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package grpc

import (
"context"
"net"

"github.com/crazy-max/diun/v4/internal/db"
Expand Down Expand Up @@ -44,7 +45,7 @@ func New(authority string, db *db.Client, notif *notif.Client) (*Client, error)
func (c *Client) Start() error {
var err error

lis, err := net.Listen("tcp", c.authority)
lis, err := (&net.ListenConfig{}).Listen(context.Background(), "tcp", c.authority)
if err != nil {
return errors.Wrap(err, "cannot create gRPC listener")
}
Expand Down
3 changes: 2 additions & 1 deletion internal/notif/discord/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ func (c *Client) Send(entry model.NotifEntry) error {

if len(c.cfg.Mentions) > 0 {
for _, mention := range c.cfg.Mentions {
content.WriteString(fmt.Sprintf("%s ", mention))
content.WriteString(mention)
content.WriteString(" ")
}
}
content.WriteString(string(body))
Expand Down
3 changes: 2 additions & 1 deletion internal/notif/script/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package script

import (
"bytes"
"context"
"os"
"os/exec"
"strings"
Expand Down Expand Up @@ -37,7 +38,7 @@ func (c *Client) Name() string {

// Send creates and sends a script notification with an entry
func (c *Client) Send(entry model.NotifEntry) error {
cmd := exec.Command(c.cfg.Cmd, c.cfg.Args...)
cmd := exec.CommandContext(context.Background(), c.cfg.Cmd, c.cfg.Args...)
setSysProcAttr(cmd)

// Capture output
Expand Down
Loading