cloudflare/pint

Public

mirrored from https://github.com/cloudflare/pintAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.3.1

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

internal/config/comparison.go

26lines · modecode

1package config
2
3import (
4 "github.com/cloudflare/pint/internal/checks"
5)
6
7type ComparisonSettings struct {
8 Severity string `hcl:"severity,optional"`
9}
10
11func (cs ComparisonSettings) validate() error {
12 if cs.Severity != "" {
13 if _, err := checks.ParseSeverity(cs.Severity); err != nil {
14 return err
15 }
16 }
17 return nil
18}
19
20func (cs ComparisonSettings) getSeverity(fallback checks.Severity) checks.Severity {
21 if cs.Severity != "" {
22 sev, _ := checks.ParseSeverity(cs.Severity)
23 return sev
24 }
25 return fallback
26}
27