prometheus/util
beorn7 0f760f63dd lint: Revamp our linting rules, mostly around doc comments
Several things done here:

- Set `max-issues-per-linter` to 0 so that we actually see all linter
  warnings and not just 50 per linter. (As we also set
  `max-same-issues` to 0, I assume this was the intention from the
  beginning.)

- Stop using the golangci-lint default excludes (by setting
  `exclude-use-default: false`. Those are too generous and don't match
  our style conventions. (I have re-added some of the excludes
  explicitly in this commit. See below.)

- Re-add the `errcheck` exclusion we have used so far via the
  defaults.

- Exclude the signature requirement `govet` has for `Seek` methods
  because we use non-standard `Seek` methods a lot. (But we keep other
  requirements, while the default excludes completely disabled the
  check for common method segnatures.)

- Exclude warnings about missing doc comments on exported symbols. (We
  used to be pretty adamant about doc comments, but stopped that at
  some point in the past. By now, we have about 500 missing doc
  comments. We may consider reintroducing this check, but that's
  outside of the scope of this commit. The default excludes of
  golangci-lint essentially ignore doc comments completely.)

- By stop using the default excludes, we now get warnings back on
  malformed doc comments. That's the most impactful change in this
  commit. It does not enforce doc comments (again), but _if_ there is
  a doc comment, it has to have the recommended form. (Most of the
  changes in this commit are fixing this form.)

- Improve wording/spelling of some comments in .golangci.yml, and
  remove an outdated comment.

- Leave `package-comments` inactive, but add a TODO asking if we
  should change that.

- Add a new sub-linter `comment-spacings` (and fix corresponding
  comments), which avoids missing spaces after the leading `//`.

Signed-off-by: beorn7 <beorn@grafana.com>
2024-08-22 17:36:11 +02:00
..
almost refactor: extract almost.Equal() to new package 2024-05-08 13:42:10 +01:00
annotations lint: Revamp our linting rules, mostly around doc comments 2024-08-22 17:36:11 +02:00
documentcli fix fmt 2024-07-15 11:59:58 +08:00
fmtutil golangci-lint: enable testifylint linter (#13254) 2023-12-07 11:35:01 +00:00
gate Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
httputil golangci-lint: enable usestdlibvars linter 2024-04-08 19:26:23 +00:00
jsonutil Name float values as "floats", not as "values" 2023-04-13 19:25:24 +02:00
junitxml promtool: JUnit-Format XML Test Results (#14506) 2024-07-29 21:28:08 +10:00
logging lint: Adjust to the lint warnings raised by current versions of golint-ci 2023-04-19 17:10:10 +02:00
osutil Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
pool Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
runtime util/runtime: Ignore nolintlint failure on OSX (#13546) 2024-02-06 13:53:37 +01:00
runutil Append Created Timestamps (#12733) 2023-12-11 08:43:42 +00:00
stats Move from golang.org/x/exp/slices into slices now that we only support Go >= 1.21 2024-02-28 14:54:53 +01:00
strutil Implement SanitizeLabelName and Full variant 2023-02-03 15:28:33 +00:00
teststorage promtool: Avoid using testify for user rule tests 2024-03-21 22:08:10 +11:00
testutil lint: Revamp our linting rules, mostly around doc comments 2024-08-22 17:36:11 +02:00
treecache golangci-lint: Enable loggercheck linter 2024-06-18 20:41:26 +02:00
zeropool golangci-lint: enable testifylint linter (#13254) 2023-12-07 11:35:01 +00:00