cert $WORK prom

exec pint --no-color config
! stdout .
cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Loading configuration file" path=.pint.hcl
{
  "ci": {
    "baseBranch": "master",
    "maxCommits": 20
  },
  "parser": {},
  "repository": {},
  "checks": {
    "enabled": [
      "alerts/absent",
      "alerts/annotation",
      "alerts/count",
      "alerts/external_labels",
      "alerts/for",
      "alerts/template",
      "labels/conflict",
      "promql/aggregate",
      "alerts/comparison",
      "promql/impossible",
      "promql/fragile",
      "promql/range_query",
      "promql/rate",
      "promql/regexp",
      "promql/syntax",
      "promql/vector_matching",
      "query/cost",
      "promql/counter",
      "promql/selector",
      "promql/series",
      "rule/dependency",
      "rule/duplicate",
      "rule/for",
      "rule/name",
      "rule/label",
      "rule/link",
      "rule/reject",
      "rule/report"
    ],
    "disabled": [
      "promql/fragile"
    ]
  },
  "owners": {},
  "prometheus": [
    {
      "name": "prom",
      "uri": "http://127.0.0.1",
      "timeout": "2m",
      "uptime": "up",
      "concurrency": 16,
      "rateLimit": 100,
      "required": true
    },
    {
      "name": "prom-with-failover",
      "uri": "http://127.0.0.1",
      "timeout": "2m0s",
      "uptime": "up",
      "failover": [
        "http://127.0.0.1",
        "http://127.0.0.1"
      ],
      "concurrency": 16,
      "rateLimit": 100,
      "required": false
    },
    {
      "name": "prom-with-tags",
      "uri": "http://127.0.0.1",
      "timeout": "2m0s",
      "uptime": "up",
      "tags": [
        "a",
        "@",
        "1"
      ],
      "concurrency": 16,
      "rateLimit": 100,
      "required": false
    },
    {
      "name": "custom-concurrency",
      "uri": "http://127.0.0.1",
      "timeout": "2m0s",
      "uptime": "up",
      "concurrency": 32,
      "rateLimit": 100,
      "required": false
    },
    {
      "name": "custom-rateLimit",
      "uri": "http://user:pass@127.0.0.1",
      "timeout": "15s",
      "uptime": "up",
      "concurrency": 16,
      "rateLimit": 1,
      "required": false
    },
    {
      "tls": {
        "skipVerify": true
      },
      "name": "tls-skipVerify",
      "uri": "http://127.0.0.1",
      "timeout": "15s",
      "uptime": "up",
      "concurrency": 16,
      "rateLimit": 100,
      "required": false
    },
    {
      "tls": {
        "caCert": "prom-ca.pem",
        "clientCert": "prom.pem",
        "clientKey": "prom.key"
      },
      "name": "tls-ca",
      "uri": "http://127.0.0.1",
      "timeout": "15s",
      "uptime": "up",
      "concurrency": 16,
      "rateLimit": 100,
      "required": false
    }
  ],
  "check": [
    {
      "ignoreMetrics": [
        ".*_error",
        ".*_error_.*",
        ".*_errors",
        ".*_errors_.*"
      ]
    },
    {
      "smelly": false
    }
  ],
  "rules": [
    {},
    {
      "reject": [
        {
          "key": ".* +.*",
          "label_keys": true,
          "annotation_keys": true
        },
        {
          "key": "https?://.+",
          "label_keys": true,
          "label_values": true
        }
      ]
    },
    {
      "match": [
        {
          "path": "foo/bar",
          "kind": "alerting"
        }
      ],
      "ignore": [
        {
          "label": {
            "key": "notify",
            "value": "blackhole"
          },
          "kind": "alerting"
        },
        {
          "command": "watch"
        }
      ],
      "annotation": [
        {
          "key": "summary",
          "severity": "bug",
          "required": true
        }
      ],
      "alerts": {
        "range": "7d",
        "step": "1m",
        "resolve": "5m"
      }
    },
    {
      "match": [
        {
          "kind": "recording"
        }
      ],
      "aggregate": [
        {
          "name": ".+",
          "keep": [
            "job"
          ]
        }
      ]
    },
    {
      "match": [
        {
          "kind": "recording"
        }
      ],
      "cost": {}
    }
  ]
}
-- .pint.hcl --
prometheus "prom" {
  uri     = "http://127.0.0.1"
  timeout = "2m"
  required = true
}

prometheus "prom-with-failover" {
  uri      = "http://127.0.0.1"
  failover = ["http://127.0.0.1", "http://127.0.0.1"]
}

prometheus "prom-with-tags" {
  uri  = "http://127.0.0.1"
  tags = ["a", "@", "1"]
}

prometheus "custom-concurrency" {
  uri         = "http://127.0.0.1"
  required    = false
  concurrency = 32
}

prometheus "custom-rateLimit" {
  uri       = "http://user:pass@127.0.0.1"
  timeout   = "15s"
  rateLimit = 1
}

prometheus "tls-skipVerify" {
  uri       = "http://127.0.0.1"
  timeout   = "15s"
  tls {
    skipVerify = true
  }
}

prometheus "tls-ca" {
  uri       = "http://127.0.0.1"
  timeout   = "15s"
  tls {
    caCert     = "prom-ca.pem"
    clientCert = "prom.pem"
    clientKey  = "prom.key"
  }
}

checks {
  disabled = ["promql/fragile"]
}

check "promql/series" {
  ignoreMetrics = [
    ".*_error",
    ".*_error_.*",
    ".*_errors",
    ".*_errors_.*",
  ]
}

check "promql/regexp" {
  smelly = false
}

rule{  }

rule {
  reject ".* +.*" {
    label_keys      = true
    annotation_keys = true
  }

  reject "https?://.+" {
    label_keys   = true
    label_values = true
  }
}


rule {
  match {
    kind = "alerting"
    path = "foo/bar"
  }
  ignore {
    kind = "alerting"
    label "notify" {
      value = "blackhole"
    }
  }
  ignore {
    command = "watch"
  }
  alerts {
    range   = "7d"
    step    = "1m"
    resolve = "5m"
  }
  annotation "summary" {
    severity = "bug"
    required = true
  }
}

rule {
  match {
    kind = "recording"
  }
  aggregate ".+" {
    keep = [ "job" ]
  }
}

rule {
  match {
    kind = "recording"
  }
  cost {}
}
