Commit graph

22 commits

Author SHA1 Message Date
Trent Albright
4f3fdc4dae
feat: add sprig template functions support (#131)
* cherry-pick from delmendo

* add tests, docs, and lift hermetic restriction

* remove duplicate funcs that are now provided by sprig

* switch func load order to allow built-ins precedence

* Update chglog.go

Co-authored-by: Dirk Elmendorf <dirk@r26d.com>
2021-03-28 22:18:36 -05:00
Khosrow Moossavi
34b9d5c997
ci: deprecate AppVoyer integration (#128)
With the migration to GitHub Action, there's no need to continue to use
AppVoyer to only test on Windows, as it's covered by corresponding new
jobs.

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-03-25 22:48:53 -05:00
Mason J. Katz
9a0d584745
feat: add support for rendering .Body after .Subject as part of list (#121)
When attempting to render a commit body below the summary line of the
commit there are two problems:

1) The text needs to be indented two spaces to appear as part of the
list.

2) Notes (e.g. BREAKING CHANGE) are included in the body and end up
being repeating in a Notes section (if this is part of your template).

To address #1 add an `indent` func to the template parsing.
To address #2 add a `TrimmedBody` to the `Commit` fields.

The `TrimmedBody` will include everything in `Body` but not any
`Ref`s, `Note`s, `Mention`s, `CoAuthors`, or `Signers`.

Both the CoAuthors and Signers are now first class in the Commit
struct.

With both of these a template block like:

```
{{ if .TrimmedBody -}}
{{ indent .TrimmedBody 2 }}
{{ end -}}
```

Will render the trimmed down body section as intended.

See TestGeneratorWithTimmedBody for example of desired output.
2021-03-22 16:04:57 -05:00
Louis DeLosSantos
ebff3d0beb
feat: allow tag sorting by semver (#124)
Relates to #123.

While this does not introduce "per-branch" tag parsing it does allow an
alternative tag sorting method which maybe a better solution.

With this commit the user can decide to sort the tags by semver instead
of dates.

This is useful where repositories are utilizing a  stable branch model
and back-ports are interleaved with new releases.

For example, if your mainline is on v3.0.0 with it's last release
1/1/2021 and a back-port release of v2.0.1 is released on 1/2/2021,
sorting by semver will correctly order the change log producing
v2.0.1 -> v2.0.1 -> v3.0.0

This functionality is completely opt-in and defaults to the original
"date" sorting

Signed-off-by: ldelossa <louis.delos@gmail.com>
2021-03-20 17:21:47 -05:00
Derek Smith
ae3382b7c8
chore(ci): add golangci-lint action and apply linting changes (#120)
BREAKING CHANGE: `JiraIssueId` has been renamed to `JiraIssueID`. This impacts the value for `pattern_maps` in `config.yml`.

* chore(ci): add golangci-lint action

* chore(lint): address errcheck lint failures

* chore(lint): address misspell lint failures

* chore(lint): address gocritic lint failures

* chore(lint): address golint lint failures

* chore(lint): address structcheck lint failures

* chore(lint): address gosimple lint failures

* chore(lint): address gofmt lint failures

* chore(ci): port to official golangci-lint github action

* Update golangci configuration for better coverage

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>

* fix: file is not goimports-ed

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>

* fix: golint and exported functions comments

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>

* chore(lint): address gosec G304 warning

* chore(lint): address uparam warnings

* chore(lint): address scopelint lint failures

* fix: cyclomatic complexity

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>

* chore(lint): address prealloc warning, noting that we are warning for now

* chore(lint): address govet and errorlint failures

* chore: clean up defer logic when checking errors

Co-authored-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-03-16 21:24:36 -05:00
Chao Li
a1c84d7a0d
feat: add Jira integration (#52) 2021-03-11 08:40:32 +01:00
tsuyoshi wada
5a55d0f51b
Merge pull request #44 from evanchaoli/tag-filter
feat: Add --tag-filter-pattern flag.
2019-09-23 20:49:37 +09:00
Chao Li
1198e283de feat: Add --tag-filter-pattern flag.
This flag specifies a regular expression and only matched tags will
be included in change log.

Closes #43
2019-07-10 09:17:01 +08:00
Stanley Goldman
f5df8faf8b
fix: Fixing tests on windows 2019-07-01 20:56:00 -04:00
tsuyoshiwada
f8f4ccb8b7 feat: Add --next-tag flag (experimental) 2018-05-05 21:44:16 +09:00
tsuyoshiwada
d008bef7fb test: Change output test of chglog to keep-a-changelog 2018-05-05 21:44:14 +09:00
tsuyoshiwada
36cf6bce12 test: Refactor for chglog test code 2018-05-05 18:54:12 +09:00
tsuyoshiwada
82d0df16a8 feat: Change to kindly error message when git-tag does not exist 2018-04-07 14:57:57 +09:00
tsuyoshiwada
b01be88230 fix: Fix error message when Tag can not be acquired 2018-02-24 00:45:52 +09:00
tsuyoshiwada
96562bcc9a test: Fix test which failed due to timezone difference 2018-02-24 00:35:19 +09:00
tsuyoshiwada
d55318c7a0 docs: Add godoc 2018-02-18 01:54:44 +09:00
tsuyoshiwada
22cfb51124 refactor: Change to return an error if corresponding commit is empty 2018-02-17 16:38:20 +09:00
tsuyoshiwada
8869631aad fix: Fix parsing of revert and body 2018-02-17 02:27:05 +09:00
tsuyoshiwada
cd9684604b chore: Fix testcase depending on datetime 2018-02-16 15:17:21 +09:00
tsuyoshiwada
8f3171633c refactor: Refactor the main logic 2018-02-16 15:01:56 +09:00
tsuyoshiwada
8b6430ea17 chore: Add e2e tests 2018-02-10 22:23:15 +09:00
tsuyoshiwada
6caf676beb feat: First implement 2018-02-10 18:11:50 +09:00