Skip to content

Commit

Permalink
Install and run po-linter
Browse files Browse the repository at this point in the history
  • Loading branch information
douglascamata committed Jan 3, 2024
1 parent 662416e commit f275c5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hack/install-go-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ go install -mod=readonly github.com/bwplotka/bingo@latest
# Once the new bingo version is released, make sure to append '-t 0' in below commands
unset GOFLAGS
bingo get -v -l github.com/prometheus/prometheus/cmd/promtool@v0.46.0
bingo get -v -l github.com/cloudflare/pint/cmd/pint@v0.44.1
bingo get -v -l github.com/cloudflare/pint/cmd/pint@v0.44.1
go install github.com/prometheus-operator/prometheus-operator/cmd/po-lint
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ func checkRules(rulesDirPath, tenant string, isGeneratingTemplate bool) {
return fmt.Errorf("failed to run 'promtool check rules' on the 'spec' part of the file; output:\n%v", output)
}

if output, err := runAndOutputCommand("po-lint", specFilePath); err != nil {
return fmt.Errorf("failed to run 'po-lint' on the file; output:\n%v", output)
}

{
var ruleGroupsObj ruleGroupsObj

Expand Down

0 comments on commit f275c5b

Please sign in to comment.