mirror of
https://github.com/git-chglog/git-chglog.git
synced 2026-01-23 02:15:12 +00:00
feat: Add support for GitLab
This commit is contained in:
parent
d446571b8c
commit
45ed6e3ee2
8 changed files with 209 additions and 7 deletions
|
|
@ -67,3 +67,65 @@ gh-56 hoge fuga`,
|
|||
),
|
||||
)
|
||||
}
|
||||
|
||||
func TestGitLabProcessor(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
config := &Config{
|
||||
Info: &Info{
|
||||
RepositoryURL: "https://example.com",
|
||||
},
|
||||
}
|
||||
|
||||
processor := &GitLabProcessor{}
|
||||
|
||||
processor.Bootstrap(config)
|
||||
|
||||
assert.Equal(
|
||||
&Commit{
|
||||
Header: "message [@foo](https://gitlab.com/foo) [#123](https://example.com/issues/123)",
|
||||
Subject: "message [@foo](https://gitlab.com/foo) [#123](https://example.com/issues/123)",
|
||||
Body: `issue [#456](https://example.com/issues/456)
|
||||
multiline [#789](https://example.com/issues/789)
|
||||
[@foo](https://gitlab.com/foo), [@bar](https://gitlab.com/bar)`,
|
||||
Notes: []*Note{
|
||||
&Note{
|
||||
Body: `issue1 [#11](https://example.com/issues/11)
|
||||
issue2 [#22](https://example.com/issues/22)
|
||||
gh-56 hoge fuga`,
|
||||
},
|
||||
},
|
||||
},
|
||||
processor.ProcessCommit(
|
||||
&Commit{
|
||||
Header: "message @foo #123",
|
||||
Subject: "message @foo #123",
|
||||
Body: `issue #456
|
||||
multiline #789
|
||||
@foo, @bar`,
|
||||
Notes: []*Note{
|
||||
&Note{
|
||||
Body: `issue1 #11
|
||||
issue2 #22
|
||||
gh-56 hoge fuga`,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
assert.Equal(
|
||||
&Commit{
|
||||
Revert: &Revert{
|
||||
Header: "revert header [@mention](https://gitlab.com/mention) [#123](https://example.com/issues/123)",
|
||||
},
|
||||
},
|
||||
processor.ProcessCommit(
|
||||
&Commit{
|
||||
Revert: &Revert{
|
||||
Header: "revert header @mention #123",
|
||||
},
|
||||
},
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue