Skip to content

Commit

Permalink
feat: support printing rules' notes (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
doron-cohen committed Dec 10, 2020
1 parent 0a06fc5 commit 891b969
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/rules/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ type Rule struct {
Dotfile *dotfile.Dotfile
Ignore bool
Actions []Action
Notes []string
}

func (r Rule) Pprint() {
tui.Print(tui.ApplyStylef(tui.Cyan, "Rule %s:", r.Name))
if len(r.Notes) != 0 {
for _, note := range r.Notes {
tui.Print(" %s %s", tui.ApplyStyle(tui.Cyan, "NOTICE"), note)
}
}

for _, action := range r.Actions {
action.Pprint()
}
Expand Down

0 comments on commit 891b969

Please sign in to comment.