Skip to content

Commit

Permalink
faet: add style block for generation
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Nov 27, 2020
1 parent 4a9e7ee commit 71a51e1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 3_transformer/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type TemplateContext struct {
Perf []*Commit
Refactor []*Commit
Test []*Commit
Style []*Commit
Revert []*Commit
BreakingChanges []*Commit
Commits []*Commit
Expand Down Expand Up @@ -119,6 +120,11 @@ func Transform(g *client.GitClient, splices []*extractor.ExtractSplice) ([]*Temp
ctx.Test = make([]*Commit, 0)
}
ctx.Test = append(ctx.Test, c)
case "style":
if ctx.Style == nil {
ctx.Style = make([]*Commit, 0)
}
ctx.Style = append(ctx.Style, c)
case "revert":
if ctx.Revert == nil {
ctx.Revert = make([]*Commit, 0)
Expand Down
5 changes: 5 additions & 0 deletions 4_generator/template_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ const FULL_TEMPLATE = `# {{ .Version }}
{{ template "body" .Docs }}
{{- end -}}
{{if .Style}}
### πŸŒ‡ Style:
{{ template "body" .Style }}
{{- end -}}
{{if .Revert}}
### πŸ”™ Revert:
{{range .Revert -}}
Expand Down
5 changes: 5 additions & 0 deletions repl/src/template/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ const TEMPLATE_DEFAULT = `# {{ .Version }}
{{ template "body" .Docs }}
{{- end -}}
{{if .Style}}
### πŸŒ‡ Style:
{{ template "body" .Style }}
{{- end -}}
{{if .Revert}}
### πŸ”™ Revert:
{{range .Revert -}}
Expand Down

0 comments on commit 71a51e1

Please sign in to comment.