Skip to content

Commit f37b6d8

Browse files
authored
Merge pull request #258 from prometheus-community/superq/update_build
Signed-off-by: Ben Kochie <[email protected]>
2 parents 9eac3ea + 9dfc275 commit f37b6d8

File tree

29 files changed

+276
-1626
lines changed

29 files changed

+276
-1626
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
executors:
44
golang:
55
docker:
6-
- image: cimg/go:1.18
6+
- image: cimg/go:1.22
77
jobs:
88
test:
99
executor: golang
@@ -104,4 +104,4 @@ workflows:
104104
tags:
105105
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
106106
orbs:
107-
prometheus: prometheus/prometheus@0.11.0
107+
prometheus: prometheus/prometheus@0.17.1

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ updates:
33
- package-ecosystem: gomod
44
directory: "/"
55
schedule:
6-
interval: daily
6+
interval: monthly
77
open-pull-requests-limit: 10
88
ignore:
99
- dependency-name: github.com/prometheus/common
Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,39 @@
1+
---
2+
# This action is synced from https://github.com/prometheus/prometheus
13
name: golangci-lint
24
on:
35
push:
4-
tags:
5-
- v*
6-
branches:
7-
- master
6+
paths:
7+
- "go.sum"
8+
- "go.mod"
9+
- "**.go"
10+
- "scripts/errcheck_excludes.txt"
11+
- ".github/workflows/golangci-lint.yml"
12+
- ".golangci.yml"
813
pull_request:
14+
15+
permissions: # added using https://github.com/step-security/secure-repo
16+
contents: read
17+
918
jobs:
1019
golangci:
20+
permissions:
21+
contents: read # for actions/checkout to fetch code
22+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
1123
name: lint
1224
runs-on: ubuntu-latest
1325
steps:
14-
- uses: actions/checkout@v3
15-
- name: golangci-lint
16-
uses: golangci/golangci-lint-action@v3
26+
- name: Checkout repository
27+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
28+
- name: Install Go
29+
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
1730
with:
18-
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
19-
version: v1.29
20-
only_new_issues: true
21-
# Optional: golangci-lint command line arguments.
22-
# args: ./the-only-dir-to-analyze/...
31+
go-version: 1.22.x
32+
- name: Install snmp_exporter/generator dependencies
33+
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
34+
if: github.repository == 'prometheus/snmp_exporter'
35+
- name: Lint
36+
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
37+
with:
38+
args: --verbose
39+
version: v1.59.1

.golangci.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,46 @@ linters:
77
disable-all: true
88
enable:
99
- bodyclose
10-
- deadcode
1110
- depguard
1211
- dogsled
1312
- errcheck
1413
- funlen
1514
- gochecknoinits
1615
- goconst
17-
- gocritic
1816
- gocyclo
1917
- gofmt
2018
- goimports
21-
- golint
2219
- goprintffuncname
2320
- gosec
2421
- gosimple
2522
- govet
2623
- ineffassign
27-
- interfacer
2824
- misspell
29-
- nakedret
30-
- nolintlint
3125
- rowserrcheck
32-
- scopelint
3326
- staticcheck
34-
- structcheck
3527
- stylecheck
3628
- typecheck
3729
- unconvert
3830
- unparam
3931
- unused
40-
- varcheck
4132
- whitespace
4233
- asciicheck
4334
- gochecknoglobals
44-
- gocognit
4535
- godot
4636
- godox
47-
- maligned
4837
- prealloc
4938
# don't enable:
5039
# - testpackage
5140
# - wsl
5241
# - lll
5342
# - gomnd
5443
# - nestif
55-
# - goerr113
44+
# - goerr113
45+
#
46+
linters-settings:
47+
depguard:
48+
rules:
49+
main:
50+
deny:
51+
- pkg: "golang.org/x/exp/slices"
52+
desc: "Use 'slices' instead."

.goreleaser.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ builds:
1818
goarm:
1919
- 7
2020

21+
ignore:
22+
- goos: windows
23+
goarch: arm
24+
goarm: 7
2125

2226
archives:
2327
checksum:

cmd/promql-langserver/promql-langserver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"os"
2323
"time"
2424

25-
kitlog "github.com/go-kit/kit/log"
25+
kitlog "github.com/go-kit/log"
2626
"github.com/prometheus-community/promql-langserver/config"
2727
promClient "github.com/prometheus-community/promql-langserver/prometheus"
2828
"github.com/prometheus/common/route"
@@ -70,7 +70,7 @@ func main() {
7070
// register the different route
7171
api.Register(router, "")
7272
// start the http server
73-
err = http.ListenAndServe(fmt.Sprint(":", conf.RESTAPIPort), router)
73+
err = http.ListenAndServe(fmt.Sprint(":", conf.RESTAPIPort), router) //nolint: gosec
7474
if err != nil {
7575
log.Fatal(err)
7676
}

config/config.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ package config
1414

1515
import (
1616
"fmt"
17-
"io/ioutil"
1817
"net/url"
1918
"os"
2019
"strconv"
@@ -38,7 +37,7 @@ func ReadConfig(configFile string) (*Config, error) {
3837
}
3938

4039
func readConfigFromYAML(configFile string) (*Config, error) {
41-
b, err := ioutil.ReadFile(configFile)
40+
b, err := os.ReadFile(configFile)
4241
if err != nil {
4342
return nil, err
4443
}
@@ -63,7 +62,7 @@ const (
6362
TextFormat LogFormat = "text"
6463
)
6564

66-
var mapLogFormat = map[LogFormat]bool{ // nolint: gochecknoglobals
65+
var mapLogFormat = map[LogFormat]bool{ //nolint: gochecknoglobals
6766
JSONFormat: true,
6867
TextFormat: true,
6968
}

config/config_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@ func TestUnmarshalENV(t *testing.T) {
5454
},
5555
}
5656
for _, testSuite := range testSuites {
57-
// nolint
5857
t.Run(testSuite.title, func(t *testing.T) {
5958
os.Clearenv()
60-
// nolint
6159
for k, v := range testSuite.variables {
6260
os.Setenv(k, v)
6361
}

go.mod

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,41 @@
11
module github.com/prometheus-community/promql-langserver
22

3-
go 1.13
3+
go 1.21
44

55
require (
66
github.com/blang/semver v3.5.1+incompatible
7-
github.com/go-kit/kit v0.12.0
8-
github.com/google/uuid v1.3.0
9-
github.com/hashicorp/errwrap v1.1.0 // indirect
7+
github.com/go-kit/log v0.2.1
8+
github.com/google/uuid v1.6.0
109
github.com/kelseyhightower/envconfig v1.4.0
1110
github.com/pkg/errors v0.9.1
12-
github.com/prometheus/client_golang v1.12.2
13-
github.com/prometheus/common v0.35.0
14-
github.com/prometheus/prometheus v0.36.2
11+
github.com/prometheus/client_golang v1.19.1
12+
github.com/prometheus/common v0.54.0
13+
github.com/prometheus/prometheus v0.47.2
1514
github.com/rakyll/statik v0.1.7
1615
github.com/sahilm/fuzzy v0.1.0
17-
github.com/stretchr/testify v1.8.0
16+
github.com/stretchr/testify v1.9.0
1817
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f
1918
gopkg.in/yaml.v3 v3.0.1
2019
)
20+
21+
require (
22+
github.com/beorn7/perks v1.0.1 // indirect
23+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
24+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
25+
github.com/dennwc/varint v1.0.0 // indirect
26+
github.com/go-logfmt/logfmt v0.6.0 // indirect
27+
github.com/gogo/protobuf v1.3.2 // indirect
28+
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect
29+
github.com/json-iterator/go v1.1.12 // indirect
30+
github.com/julienschmidt/httprouter v1.3.0 // indirect
31+
github.com/kr/text v0.2.0 // indirect
32+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
33+
github.com/modern-go/reflect2 v1.0.2 // indirect
34+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
35+
github.com/prometheus/client_model v0.6.1 // indirect
36+
github.com/prometheus/procfs v0.12.0 // indirect
37+
go.uber.org/atomic v1.11.0 // indirect
38+
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 // indirect
39+
golang.org/x/sys v0.21.0 // indirect
40+
google.golang.org/protobuf v1.34.1 // indirect
41+
)

0 commit comments

Comments
 (0)