prometheus/cmd/promtool
Filip Petkovski 1c1b174a8e
Add a --lint flag to the promtool check rules and check config commands (#10435)
* Add a --lint flag to the promtool check rules and check config commands

Checking rules with promtool emits warnings in the case of duplicate rules.
These warnings do not result in a non-zero exit code and are difficult to
spot in CI environments. Additionally, checking for duplicates is closer
to a lint check rather than a syntax check.

This commit adds a --lint flag to commands which include checking rules.
The flag can be used to enable or disable certain linting options
and cause the execution to return a non-zero exit code in case
those options are not met.

Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>

* Exit with status 3 on lint error

Signed-off-by: fpetkovski <filip.petkovsky@gmail.com>
2022-04-06 00:05:11 -04:00
..
testdata Add '--weight' flag to 'promtool check metrics' command (#10045) 2022-01-07 16:58:28 -05:00
archive.go Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
backfill.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
backfill_test.go cmd: use t.TempDir instead of ioutil.TempDir on tests (#9852) 2021-11-23 20:09:28 -05:00
debug.go Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
main.go Add a --lint flag to the promtool check rules and check config commands (#10435) 2022-04-06 00:05:11 -04:00
main_test.go Add '--weight' flag to 'promtool check metrics' command (#10045) 2022-01-07 16:58:28 -05:00
rules.go Add SyncForState Implementation for Ruler HA (#10070) 2022-03-29 02:16:46 +02:00
rules_test.go cmd: use t.TempDir instead of ioutil.TempDir on tests (#9852) 2021-11-23 20:09:28 -05:00
sd.go replace config exit code with failure exit code 2021-12-30 05:37:57 -08:00
sd_test.go Remove check against cfg so interval/ timeout are always set (#10023) 2021-12-16 13:28:46 +01:00
tsdb.go cmd: use os.MkdirTemp instead of ioutil.TempDir (#10320) 2022-03-08 14:08:53 +01:00
unittest.go Add SyncForState Implementation for Ruler HA (#10070) 2022-03-29 02:16:46 +02:00
unittest_test.go Disable time based retention in tests (#8818) 2022-01-02 23:46:03 +01:00