Skip to content

Commit

Permalink
Merge branch 'master' into add-drm-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jritter committed Jun 8, 2024
2 parents 60d40ca + f360499 commit 7665745
Show file tree
Hide file tree
Showing 202 changed files with 24,584 additions and 8,978 deletions.
31 changes: 10 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ version: 2.1
jobs:
lint:
docker:
- image: cimg/go:1.16
- image: cimg/go:1.22
steps:
- checkout
- run: make check_license
- run: ./scripts/check_build_tags.sh
- run: make fixtures
- run: make update_fixtures
- run: make style
- run: git diff --exit-code

test:
Expand All @@ -23,26 +24,17 @@ jobs:
type: boolean
default: true
docker:
- image: circleci/golang:<< parameters.go_version >>
- image: cimg/go:<< parameters.go_version >>
environment:
GOOS: "<< parameters.os >>"
steps:
- checkout
- run: make style lint
- run: make lint
- when:
condition: << parameters.run_test >>
steps:
- run: make test

codespell:
docker:
- image: circleci/python

steps:
- checkout
- run: sudo pip install codespell
- run: codespell --skip=".git,./vendor,ttar,fixtures.ttar,./fixtures,go.mod,go.sum" -L uint,packages\',ded,alo,als,te,sie,hart,hda

workflows:
version: 2
procfs:
Expand All @@ -54,19 +46,16 @@ workflows:
matrix:
parameters:
go_version:
- "1.13"
- "1.14"
- "1.15"
- "1.16"
- "1.20"
- "1.21"
- "1.22"
- test:
name: test-windows
os: windows
run_test: false
matrix:
parameters:
go_version:
- "1.13"
- "1.14"
- "1.15"
- "1.16"
- codespell
- "1.20"
- "1.21"
- "1.22"
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "monthly"
39 changes: 39 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
# This action is synced from https://github.com/prometheus/prometheus
name: golangci-lint
on:
push:
paths:
- "go.sum"
- "go.mod"
- "**.go"
- "scripts/errcheck_excludes.txt"
- ".github/workflows/golangci-lint.yml"
- ".golangci.yml"
pull_request:

permissions: # added using https://github.com/step-security/secure-repo
contents: read

jobs:
golangci:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.22.x
- name: Install snmp_exporter/generator dependencies
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter'
- name: Lint
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
with:
args: --verbose
version: v1.59.0
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/fixtures/
/testdata/fixtures/
/fixtures
24 changes: 23 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
---
linters:
enable:
- golint
- errcheck
- godot
- gofmt
- goimports
- gosimple
- govet
- ineffassign
- misspell
- revive
- staticcheck
- testifylint
- unused

linter-settings:
godot:
capital: true
exclude:
# Ignore "See: URL"
- 'See:'
goimports:
local-prefixes: github.com/prometheus/procfs
misspell:
locale: US
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Prometheus Community Code of Conduct
# Prometheus Community Code of Conduct

Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Many of the files are changing continuously and the data being read can in some
reads in the same file. Also, most of the files are relatively small (less than a few KBs), and system calls
to the `stat` function will often return the wrong size. Therefore, for most files it's recommended to read the
full file in a single operation using an internal utility function called `util.ReadFileNoStat`.
This function is similar to `ioutil.ReadFile`, but it avoids the system call to `stat` to get the current size of
This function is similar to `os.ReadFile`, but it avoids the system call to `stat` to get the current size of
the file.

Note that parsing the file's contents can still be performed one line at a time. This is done by first reading
Expand All @@ -113,7 +113,7 @@ the full file, and then using a scanner on the `[]byte` or `string` containing t
```

The `/sys` filesystem contains many very small files which contain only a single numeric or text value. These files
can be read using an internal function called `util.SysReadFile` which is similar to `ioutil.ReadFile` but does
can be read using an internal function called `util.SysReadFile` which is similar to `os.ReadFile` but does
not bother to check the size of the file before reading.
```
data, err := util.SysReadFile("/sys/class/power_supply/BAT0/capacity")
Expand Down
3 changes: 2 additions & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* Johannes 'fish' Ziemke <[email protected]> @discordianfish
* Paul Gier <[email protected]> @pgier
* Paul Gier <[email protected]> @pgier
* Ben Kochie <[email protected]> @SuperQ
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
include Makefile.common

%/.unpacked: %.ttar
@echo ">> extracting fixtures"
@echo ">> extracting fixtures $*"
./ttar -C $(dir $*) -x -f $*.ttar
touch $@

fixtures: fixtures/.unpacked
fixtures: testdata/fixtures/.unpacked

update_fixtures:
rm -vf fixtures/.unpacked
./ttar -c -f fixtures.ttar fixtures/
rm -vf testdata/fixtures/.unpacked
./ttar -c -f testdata/fixtures.ttar -C testdata/ fixtures/

.PHONY: build
build:

.PHONY: test
test: fixtures/.unpacked common-test
test: testdata/fixtures/.unpacked common-test
Loading

0 comments on commit 7665745

Please sign in to comment.