prometheus/promql/parser
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
..
posrange Add warnings (and annotations) to PromQL query results (#12152) 2023-09-14 18:57:31 +02:00
ast.go lint: Revamp our linting rules, mostly around doc comments 2024-08-22 17:36:11 +02:00
functions.go promql: add histogram_avg function (#13467) 2024-02-01 18:28:42 +01:00
generated_parser.y support quoting in grouping label lists 2024-08-01 10:07:12 -04:00
generated_parser.y.go support quoting in grouping label lists 2024-08-01 10:07:12 -04:00
lex.go Upgrade golangci-lint to v1.60.1 2024-08-18 12:13:25 +02:00
lex_test.go parser: support underscores 2024-06-27 19:20:52 +05:30
parse.go promqltest: add support for setting counter reset hint on histogram samples (#14537) 2024-07-31 09:53:05 +02:00
parse_test.go support quoting in grouping label lists 2024-08-01 10:07:12 -04:00
prettier.go Adds support for prettifying PromQL expression (#10544) 2022-07-07 18:13:36 +05:30
prettier_rules.md Adds support for prettifying PromQL expression (#10544) 2022-07-07 18:13:36 +05:30
prettier_test.go Prettifier: Add spaces with non-callable keywords (#11005) 2022-07-15 00:09:56 +02:00
printer.go support quoting in grouping label lists 2024-08-01 10:07:12 -04:00
printer_test.go support quoting in grouping label lists 2024-08-01 10:07:12 -04:00
value.go promql: use explicit type declare instead of string. (#7716) 2020-08-02 09:57:38 +01:00