-
Notifications
You must be signed in to change notification settings - Fork 0
/
module.go
38 lines (34 loc) · 936 Bytes
/
module.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package goodcommit
import "github.com/charmbracelet/huh"
type Commit struct {
Type string
Scope string
Scopes []string
Description string
Body string
Footer string
Breaking bool
CoAuthoredBy []string
Extras map[string]*string
}
type ModuleConfig struct {
Page int `json:"page"`
Position int `json:"position"`
Name string `json:"name"`
Active bool `json:"active"`
Path string `json:"path,omitempty"`
Priority int `json:"priority"`
Checkpoint bool `json:"checkpoint"`
Pinned bool `json:"pinned"`
Dependencies []string `json:"dependencies"`
}
type Module interface {
LoadConfig() error
NewField(commit *Commit) (huh.Field, error)
PostProcess(commit *Commit) error
Config() ModuleConfig
Name() string
SetConfig(config ModuleConfig)
InitCommitInfo(commit *Commit) error
IsActive() bool
}