Skip to content

Commit 5787126

Browse files
authored
chore: switch to slog (#1614)
1 parent 6c5b4ba commit 5787126

File tree

91 files changed

+1738
-1018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1738
-1018
lines changed

.editorconfig

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
root = true
22

3-
[*.wxs]
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
tab_width = 4
49

10+
[*.{json,wxs,xml}]
511
indent_style = space
6-
indent_size = 4
12+
indent_size = 4
13+
14+
[*.{yml,yaml}]
15+
indent_style = space
16+
indent_size = 2

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ jobs:
105105
uses: golangci/golangci-lint-action@v6
106106
with:
107107
version: v1.60
108-
args: "--timeout=5m --max-same-issues=0"
108+
args: "--max-same-issues=0"

.golangci.yaml

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
linters:
22
enable-all: true
33
disable:
4-
- containedctx
5-
- contextcheck
64
- cyclop
75
- depguard
8-
- dogsled
96
- dupl
107
- err113
8+
- execinquery
119
- exhaustive
1210
- exhaustruct
1311
- exportloopref
@@ -17,21 +15,16 @@ linters:
1715
- gocognit
1816
- goconst
1917
- gocyclo
20-
- godox
21-
- inamedparam
22-
- ireturn
18+
- gomnd
2319
- lll
20+
- maintidx
2421
- mnd
25-
- nlreturn
26-
- noctx
2722
- testpackage
2823
- varnamelen
2924
- wrapcheck
30-
- wsl
31-
- execinquery
32-
- gomnd
33-
- stylecheck
34-
- maintidx
25+
26+
run:
27+
timeout: 5m
3528

3629
linters-settings:
3730
gosec:
@@ -52,13 +45,33 @@ linters-settings:
5245
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `upperSnake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`, `header`
5346
json: camel
5447
yaml: snake
48+
gomoddirectives:
49+
replace-allow-list:
50+
- github.com/prometheus/common # https://github.com/prometheus/common/pull/694
5551
forbidigo:
5652
forbid:
5753
- "^(fmt\\.Print(|f|ln)|print|println)$"
5854
- p: "^syscall\\..*$"
5955
msg: use golang.org/x/sys/windows instead of syscall
6056
- p: "^windows\\.NewLazyDLL$"
6157
msg: use NewLazySystemDLL instead NewLazyDLL
58+
sloglint:
59+
no-mixed-args: true
60+
kv-only: false
61+
attr-only: true
62+
no-global: "all"
63+
context: "scope"
64+
static-msg: false
65+
no-raw-keys: false
66+
key-naming-case: snake
67+
forbidden-keys:
68+
- time
69+
- level
70+
- msg
71+
- source
72+
args-on-sep-lines: true
73+
stylecheck:
74+
checks: ["all", "-ST1003"]
6275
issues:
6376
exclude:
6477
- don't use underscores in Go names
@@ -72,3 +85,7 @@ issues:
7285
- text: "don't use ALL_CAPS in Go names; use CamelCase"
7386
linters:
7487
- revive
88+
- path: pkg/perflib/
89+
linters:
90+
- godox
91+
- stylecheck

.promu.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
go:
2-
version: 1.20
2+
# Whenever the Go version is updated here,
3+
# .github/workflows should also be updated.
4+
version: 1.23
35
repository:
4-
path: github.com/prometheus-community/windows_exporter
6+
path: github.com/prometheus-community/windows_exporter
57
build:
6-
binaries:
7-
- name: windows_exporter
8-
ldflags: |
9-
-X github.com/prometheus/common/version.Version={{.Version}}
10-
-X github.com/prometheus/common/version.Revision={{.Revision}}
11-
-X github.com/prometheus/common/version.Branch={{.Branch}}
12-
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
13-
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
8+
binaries:
9+
- name: windows_exporter
10+
tags:
11+
all:
12+
- trimpath
13+
ldflags: |
14+
-X github.com/prometheus/common/version.Version={{.Version}}
15+
-X github.com/prometheus/common/version.Revision={{.Revision}}
16+
-X github.com/prometheus/common/version.Branch={{.Branch}}
17+
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
18+
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
1419
tarball:
15-
files:
16-
- LICENSE
20+
files:
21+
- LICENSE
1722
crossbuild:
18-
platforms:
19-
- windows
23+
platforms:
24+
- windows

0 commit comments

Comments
 (0)