prometheus/cmd/promtool
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
..
testdata Fix yaml file format and clear ci errors 2024-03-21 11:32:02 +08:00
analyze.go Add analyze histograms command to promtool (#12331) 2024-01-10 17:32:36 +01:00
analyze_test.go Add analyze histograms command to promtool (#12331) 2024-01-10 17:32:36 +01:00
archive.go Use github.com/klauspost/compress for gzip and zlib 2024-02-22 17:08:15 +00:00
backfill.go tsdb: Extend compactor interface to allow compactions to create multiple output blocks (#14143) 2024-06-12 17:31:25 -04:00
backfill_test.go Tests: use replacement DeepEquals using go-cmp 2024-02-08 19:30:20 +00:00
debug.go refactor (package cmd): move from github.com/pkg/errors to 'errors' and 'fmt' packages (#10733) 2022-05-24 16:58:59 +10:00
main.go lint: Revamp our linting rules, mostly around doc comments 2024-08-22 17:36:11 +02:00
main_test.go Enable perfsprint linter and fix up code 2024-05-15 17:51:05 +03:00
metrics.go lint: Revamp our linting rules, mostly around doc comments 2024-08-22 17:36:11 +02:00
query.go Add analyze histograms command to promtool (#12331) 2024-01-10 17:32:36 +01:00
rules.go refactor: utilize standard functions max/min 2024-04-04 03:15:38 +09:00
rules_test.go golangci-lint: enable whitespace linter (#13905) 2024-04-11 09:27:54 +01:00
sd.go promtool: use go-cmp instead of DeepEqual 2024-02-08 19:30:20 +00:00
sd_test.go Tests: use replacement DeepEquals using go-cmp 2024-02-08 19:30:20 +00:00
tsdb.go Upgrade golangci-lint to v1.60.1 2024-08-18 12:13:25 +02:00
tsdb_test.go [Tests] Promtool: Sort output where Prometheus does not guarantee the order. 2024-08-14 11:19:02 +01:00
unittest.go promtool: JUnit-Format XML Test Results (#14506) 2024-07-29 21:28:08 +10:00
unittest_test.go promtool: JUnit-Format XML Test Results (#14506) 2024-07-29 21:28:08 +10:00