Skip to content

Commit 222a964

Browse files
authored
Merge pull request #1 from CodeYogiCo/update-all-depependecies
feat: update golang and dependecies
2 parents b83e1b1 + f741b68 commit 222a964

15 files changed

Lines changed: 59 additions & 60 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Check out the repo
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414
- name: Docker Login
15-
uses: docker/login-action@v1
15+
uses: docker/login-action@v3
1616
with:
1717
username: ${{ secrets.DOCKERHUB_USERNAME }}
1818
password: ${{ secrets.DOCKERHUB_TOKEN }}
1919
- name: Docker Build and Push
2020
id: docker_build
21-
uses: docker/build-push-action@v2
21+
uses: docker/build-push-action@v6
2222
with:
2323
push: true
2424
tags: |
25-
target/pull-request-code-coverage:latest
26-
target/pull-request-code-coverage:${{ github.event.release.tag_name }}
25+
pullrequestcc/pull-request-code-coverage:latest
26+
pullrequestcc/pull-request-code-coverage:${{ github.event.release.tag_name }}

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4
1010

1111
- name: Set up Go
12-
uses: actions/setup-go@v2
12+
uses: actions/setup-go@v5
1313
with:
14-
go-version: 1.17
14+
go-version: 1.26.3
1515

1616
- name: Build
1717
run: go build -v ./...

.golangci.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,35 @@
1+
version: "2"
2+
13
linters:
2-
disable-all: true
4+
default: none
35
enable:
46
- bodyclose
5-
- deadcode
6-
- depguard
77
- dogsled
88
- errcheck
99
- gochecknoinits
1010
- goconst
1111
- gocritic
1212
- gocyclo
13-
- gofmt
14-
- goimports
15-
- golint
1613
- goprintffuncname
1714
- gosec
1815
- govet
1916
- ineffassign
20-
- interfacer
21-
- maligned
2217
- misspell
2318
- nakedret
2419
- rowserrcheck
25-
- scopelint
2620
- staticcheck
27-
- structcheck
28-
- stylecheck
29-
- typecheck
3021
- unconvert
3122
- unparam
3223
- unused
33-
- varcheck
34-
issues:
35-
exclude-rules:
36-
- path: _test\.go
37-
linters:
38-
- scopelint
39-
- funlen
24+
exclusions:
25+
rules:
26+
- path: _test\.go
27+
linters:
28+
- funlen
29+
- goconst
30+
- gosec
31+
32+
formatters:
33+
enable:
34+
- gofmt
35+
- goimports

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.17-alpine as builder
1+
FROM golang:1.26.3-alpine AS builder
22
WORKDIR /go/src/github.com/target/pull-request-code-coverage
33
COPY . .
44
ENV GO111MODULE=on

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ check-gofmt:
2121
echo "Success - way to run gofmt!"; \
2222
fi
2323

24+
GOLANGCI_LINT_VERSION=v2.12.2
25+
2426
bin/golangci-lint:
2527
mkdir -p bin
26-
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.24.0
28+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b ./bin $(GOLANGCI_LINT_VERSION)
2729

2830
.PHONY: lint
2931
lint: bin/golangci-lint

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Once you have coverage.xml same can be passed as an input to plugin shown below
9292
9393
# Development
9494
95-
This project needs go (>= 1.17) to be installed. Make sure you run
95+
This project needs go (>= 1.26.3) to be installed. Make sure you run
9696
* make format
9797
* make lint
9898

go.mod

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
module github.com/target/pull-request-code-coverage
22

3-
go 1.17
3+
go 1.26.3
44

55
require (
66
github.com/pkg/errors v0.9.1
7-
github.com/sirupsen/logrus v1.8.1
8-
github.com/stretchr/testify v1.7.0
9-
7+
github.com/sirupsen/logrus v1.9.4
8+
github.com/stretchr/testify v1.11.1
109
)
1110

1211
require (
1312
github.com/davecgh/go-spew v1.1.1 // indirect
1413
github.com/pmezard/go-difflib v1.0.0 // indirect
15-
github.com/stretchr/objx v0.1.0 // indirect
16-
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 // indirect
17-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
14+
github.com/stretchr/objx v0.5.3 // indirect
15+
golang.org/x/sys v0.44.0 // indirect
16+
gopkg.in/yaml.v3 v3.0.1 // indirect
1817
)

go.sum

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
21
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
32
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
43
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
54
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
65
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
76
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
8-
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
9-
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
10-
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
11-
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
12-
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
13-
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
14-
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
15-
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
16-
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
7+
github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=
8+
github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=
9+
github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4=
10+
github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0=
11+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
12+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
13+
golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ=
14+
golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
1715
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1816
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
19-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
20-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
17+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
18+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

internal/plugin/coverage/cobertura/report.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package cobertura
33
import (
44
"encoding/xml"
55
"io"
6-
"io/ioutil"
76

87
"log"
98
"os"
@@ -22,7 +21,7 @@ type DefaultLoader struct {
2221

2322
func NewReportLoader(sourceDir string) *DefaultLoader {
2423
return &DefaultLoader{
25-
readAllFunc: ioutil.ReadAll,
24+
readAllFunc: io.ReadAll,
2625
sourceDir: sourceDir,
2726
}
2827
}

internal/plugin/coverage/jacoco/report.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"encoding/xml"
55

66
"io"
7-
"io/ioutil"
87

98
"log"
109
"os"
@@ -20,12 +19,12 @@ type DefaultLoader struct {
2019

2120
func NewReportLoader() *DefaultLoader {
2221
return &DefaultLoader{
23-
readAllFunc: ioutil.ReadAll,
22+
readAllFunc: io.ReadAll,
2423
}
2524
}
2625

2726
func (l *DefaultLoader) Load(coverageFile string) (coverage.Report, error) {
28-
// nolint: gosec
27+
// nolint: gosec // coverageFile is a user-supplied report path; opening it is the intended behavior
2928
xmlFile, openFileErr := os.Open(coverageFile)
3029

3130
if openFileErr != nil {
@@ -96,7 +95,7 @@ type SourceFile struct {
9695
func (f SourceFile) GetCoverageData(lineNumber int) (*domain.CoverageData, bool) {
9796
for _, l := range f.Lines {
9897
if l.LineNumber == lineNumber {
99-
coverageData := l.CoverageData.toDomain()
98+
coverageData := l.toDomain()
10099
return &coverageData, true
101100
}
102101
}

0 commit comments

Comments
 (0)