prometheus/promql
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
..
fuzz-data textparse: Add fuzzing and fix bug caught 2017-07-07 11:12:17 +02:00
parser lint: Revamp our linting rules, mostly around doc comments 2024-08-22 17:36:11 +02:00
promqltest Merge pull request #14655 from suntala/suntala/sort-by-label-enhancement 2024-08-21 12:28:55 +02:00
bench_test.go promql: add avg aggregation benchmark 2024-07-04 18:59:30 +02:00
engine.go lint: Revamp our linting rules, mostly around doc comments 2024-08-22 17:36:11 +02:00
engine_internal_test.go refactor: extract some PromQL Engine tests which use unexported structs 2024-05-08 16:27:17 +01:00
engine_test.go Add unit test 2024-08-06 20:50:51 +02:00
functions.go Merge pull request #14655 from suntala/suntala/sort-by-label-enhancement 2024-08-21 12:28:55 +02:00
functions_internal_test.go Fix issue where summation of +/- infinity returns NaN instead of infinity 2024-06-28 11:26:54 +10:00
functions_test.go test: move most PromQL tests into separate test package 2024-05-08 16:28:56 +01:00
fuzz.go textparse: Implement CreatedTimestamp() in openmetricsparse.go (#14356) 2024-08-08 12:35:35 +01:00
fuzz_test.go remove obsolete build tag 2024-01-17 22:26:32 +08:00
histogram_stats_iterator.go Use CopyTo when resetting histogram in stats iterator 2024-07-31 11:18:47 +02:00
histogram_stats_iterator_test.go Add more test cases 2024-07-29 14:53:32 +02:00
promql_test.go feat: add limitk() and limit_ratio() operators (#12503) 2024-07-03 22:18:57 +02:00
quantile.go Merge branch 'main' into nhcb 2024-05-14 16:20:15 +08:00
quantile_test.go PromQL: ignore small errors for bucketQuantile (#13153) 2023-11-25 00:05:38 +01:00
query_logger.go Join errors 2024-05-27 17:14:17 +02:00
query_logger_test.go promql.ActiveQueryTracker: Unmap mmapped file when done 2024-05-09 14:27:29 +02:00
value.go Optimize histogram iterators (#13340) 2024-01-23 17:02:14 +01:00
value_test.go test: move most PromQL tests into separate test package 2024-05-08 16:28:56 +01:00