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
14 changes: 12 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
root = true

[*.wxs]
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
tab_width = 4

[*.{json,wxs,xml}]
indent_style = space
indent_size = 4
indent_size = 4

[*.{yml,yaml}]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
args: "--timeout=5m --max-same-issues=0"
args: "--max-same-issues=0"
43 changes: 30 additions & 13 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
linters:
enable-all: true
disable:
- containedctx
- contextcheck
- cyclop
- depguard
- dogsled
- dupl
- err113
- execinquery
- exhaustive
- exhaustruct
- exportloopref
Expand All @@ -17,21 +15,16 @@ linters:
- gocognit
- goconst
- gocyclo
- godox
- inamedparam
- ireturn
- gomnd
- lll
- maintidx
- mnd
- nlreturn
- noctx
- testpackage
- varnamelen
- wrapcheck
- wsl
- execinquery
- gomnd
- stylecheck
- maintidx

run:
timeout: 5m

linters-settings:
gosec:
Expand All @@ -52,13 +45,33 @@ linters-settings:
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `upperSnake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`, `header`
json: camel
yaml: snake
gomoddirectives:
replace-allow-list:
- github.com/prometheus/common # https://github.com/prometheus/common/pull/694
forbidigo:
forbid:
- "^(fmt\\.Print(|f|ln)|print|println)$"
- p: "^syscall\\..*$"
msg: use golang.org/x/sys/windows instead of syscall
- p: "^windows\\.NewLazyDLL$"
msg: use NewLazySystemDLL instead NewLazyDLL
sloglint:
no-mixed-args: true
kv-only: false
attr-only: true
no-global: "all"
context: "scope"
static-msg: false
no-raw-keys: false
key-naming-case: snake
forbidden-keys:
- time
- level
- msg
- source
args-on-sep-lines: true
stylecheck:
checks: ["all", "-ST1003"]
issues:
exclude:
- don't use underscores in Go names
Expand All @@ -72,3 +85,7 @@ issues:
- text: "don't use ALL_CAPS in Go names; use CamelCase"
linters:
- revive
- path: pkg/perflib/
linters:
- godox
- stylecheck
33 changes: 19 additions & 14 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
go:
version: 1.20
# Whenever the Go version is updated here,
# .github/workflows should also be updated.
version: 1.23
repository:
path: github.com/prometheus-community/windows_exporter
path: github.com/prometheus-community/windows_exporter
build:
binaries:
- name: windows_exporter
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
-X github.com/prometheus/common/version.Branch={{.Branch}}
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
binaries:
- name: windows_exporter
tags:
all:
- trimpath
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
-X github.com/prometheus/common/version.Branch={{.Branch}}
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
tarball:
files:
- LICENSE
files:
- LICENSE
crossbuild:
platforms:
- windows
platforms:
- windows
Loading