• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / cli / 9411273834

07 Jun 2024 03:37AM UTC coverage: 60.098% (+0.007%) from 60.091%
9411273834

push

github

web-flow
 fix: log workdir if different from cwd (#2390)

* chore: dedupe enum flag parser

* fix: log workdir if different from cwd

0 of 4 new or added lines in 2 files covered. (0.0%)

2 existing lines in 2 files now uncovered.

6898 of 11478 relevant lines covered (60.1%)

634.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

53.33
/internal/utils/enum.go
1
package utils
2

3
import (
4
        "fmt"
5
        "strings"
6

7
        "github.com/go-errors/errors"
8
)
9

10
// Ref: https://github.com/spf13/pflag/issues/236#issuecomment-931600452
11
type EnumFlag struct {
12
        Allowed []string
13
        Value   string
14
}
15

16
func (a EnumFlag) String() string {
13✔
17
        return a.Value
13✔
18
}
13✔
19

20
func (a *EnumFlag) Set(p string) error {
×
NEW
21
        if !SliceContains(a.Allowed, p) {
×
22
                return errors.Errorf("must be one of [ %s ]", strings.Join(a.Allowed, " | "))
×
23
        }
×
24
        a.Value = p
×
25
        return nil
×
26
}
27

28
func (a *EnumFlag) Type() string {
1✔
29
        values := strings.Join(a.Allowed, " | ")
1✔
30
        if len(values) < 40 {
2✔
31
                return fmt.Sprintf("[ %s ]", values)
1✔
32
        }
1✔
33
        return "string"
×
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc