Skip to content

Commit

Permalink
Merge pull request #7 from PDOK/PDOK-17406-upgrade-github-actions
Browse files Browse the repository at this point in the history
Bump actions/cache from v2 to v4
  • Loading branch information
rkettelerij authored Feb 28, 2025
2 parents 45b8a1a + 72ad233 commit 8245dfe
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
Expand Down
25 changes: 18 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ issues:
linters:
- bodyclose
- dupl
- dogsled
- funlen

output:
format: colored-line-number
formats: colored-line-number
print-issued-lines: true
print-linter-name: true

Expand All @@ -37,11 +38,15 @@ linters-settings:
skip-tests: true
funlen:
lines: 100
gomoddirectives:
replace-allow-list:
- github.com/abbot/go-http-auth # https://github.com/traefik/traefik/issues/6873#issuecomment-637654361
nestif:
min-complexity: 6
forbidigo:
forbid:
- http\.NotFound.* # return RFC 7807 problem details instead
- http\.Error.* # return RFC 7807 problem details instead
gomoddirectives:
replace-allow-list:
- github.com/abbot/go-http-auth

linters:
disable-all: true
Expand All @@ -62,23 +67,28 @@ linters:
- cyclop # checks function and package cyclomatic complexity
- dupl # tool for code clone detection
- durationcheck # checks for two durations multiplied together
- dogsled # find assignments/declarations with too many blank identifiers
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
- execinquery # checks query string in Query function which reads your Go src files and warning it finds
- exhaustive # checks exhaustiveness of enum switch statements
- exportloopref # checks for pointers to enclosing loop variables
- exptostd # detects functions from golang.org/x/exp/ that can be replaced by std functions
- copyloopvar # checks for pointers to enclosing loop variables
- fatcontext # detects nested contexts in loops and function literals
- forbidigo # forbids identifiers
- funlen # tool for detection of long functions
- gocheckcompilerdirectives # validates go compiler directive comments (//go:)
- goconst # finds repeated strings that could be replaced by a constant
- gocritic # provides diagnostics that check for bugs, performance and style issues
- gofmt # checks if the code is formatted according to 'gofmt' command
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
- gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
- gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations
- goprintffuncname # checks that printf-like functions are named with f at the end
- gosec # inspects source code for security problems
- loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
- makezero # finds slice declarations with non-zero initial length
- mirror # reports wrong mirror patterns of bytes/strings usage
- misspell # finds commonly misspelled English words
- nakedret # finds naked returns in functions greater than a specified function length
- nestif # reports deeply nested if statements
- nilerr # finds the code that returns nil even if it checks that the error is not nil
Expand All @@ -92,7 +102,8 @@ linters:
- rowserrcheck # checks whether Err of rows is checked successfully
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
- sloglint # A Go linter that ensures consistent code style when using log/slog
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17
- tagliatelle # checks the struct tags.
- usetesting # detects using os.Setenv instead of t.Setenv since Go1.17
- testableexamples # checks if examples are testable (have an expected output)
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
- unconvert # removes unnecessary type conversions
Expand Down
6 changes: 3 additions & 3 deletions internal/model/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ type UptimeCheck struct {
Name string `json:"name"`
URL string `json:"url"`
Tags []string `json:"tags"`
RequestHeaders map[string]string `json:"request_headers"`
StringContains string `json:"string_contains"`
StringNotContains string `json:"string_not_contains"`
RequestHeaders map[string]string `json:"request_headers"` //nolint:tagliatelle // grandfathered in
StringContains string `json:"string_contains"` //nolint:tagliatelle // grandfathered in
StringNotContains string `json:"string_not_contains"` //nolint:tagliatelle // grandfathered in
}

func NewUptimeCheck(ingressName string, annotations map[string]string) (*UptimeCheck, error) {
Expand Down
4 changes: 2 additions & 2 deletions internal/service/providers/pingdom.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ func (m *PingdomUptimeProvider) checkToJSON(check model.UptimeCheck, includeType
// update messages shouldn't include 'type', since the type of check can't be modified in Pingdom.
message["type"] = "http"
}
if m.settings.UserIDs != nil && len(m.settings.UserIDs) > 0 {
if len(m.settings.UserIDs) > 0 {
message["userids"] = m.settings.UserIDs
}
if m.settings.IntegrationIDs != nil && len(m.settings.IntegrationIDs) > 0 {
if len(m.settings.IntegrationIDs) > 0 {
message["integrationids"] = m.settings.IntegrationIDs
}

Expand Down

0 comments on commit 8245dfe

Please sign in to comment.