Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func changelogWithSingleEntry(entry entry.Entry, repoName, repoOwner string) cha
entry.Next = nil
entry.Previous = nil

cl := changelog.NewChangelog(repoName, repoOwner)
cl := changelog.NewChangelog(repoOwner, repoName)
cl.Insert(entry)
return cl
}
Expand Down
2 changes: 1 addition & 1 deletion internal/writer/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const (
)

func Test_ItWritesOutAChangelogInTheCorrectFormat(t *testing.T) {
mockChangelog := changelog.NewChangelog(repoName, repoOwner)
mockChangelog := changelog.NewChangelog(repoOwner, repoName)

entry := entry.Entry{
Tag: "v1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion pkg/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ func NewBuilder(options BuilderOptions) (Builder, error) {
}

changelog := changelog.NewChangelog(
options.GitHubClient.GetRepoName(),
options.GitHubClient.GetRepoOwner(),
options.GitHubClient.GetRepoName(),
)

builder := &builder{
Expand Down
2 changes: 1 addition & 1 deletion pkg/changelog/changelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (c *changelog) Tail() *entry.Entry {
}

// NewChangelog creates a new changelog datastructure.
func NewChangelog(repoName string, repoOwner string) Changelog {
func NewChangelog(repoOwner string, repoName string) Changelog {
Comment thread
Ramesh7 marked this conversation as resolved.
return &changelog{
repoName: repoName,
repoOwner: repoOwner,
Expand Down
12 changes: 6 additions & 6 deletions pkg/changelog/changelog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ var entries = []entry.Entry{
}

func TetstNewChangelog(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
assert.Equal(t, repoName, testChangelog.GetRepoName())
assert.Equal(t, repoOwner, testChangelog.GetRepoOwner())
assert.Equal(t, 0, len(testChangelog.GetEntries()))
assert.Equal(t, 0, len(testChangelog.GetUnreleased()))
}

func TestInsert(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
for _, e := range entries {
err := e.Append("added", "test")
assert.Nil(t, err)
Expand All @@ -49,7 +49,7 @@ func TestInsert(t *testing.T) {
}

func TestTail(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)

for _, e := range entries {
err := e.Append("added", "test")
Expand All @@ -63,7 +63,7 @@ func TestTail(t *testing.T) {
}

func TestHead(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
entries := []entry.Entry{
{
Tag: "v2.0.0",
Expand All @@ -87,7 +87,7 @@ func TestHead(t *testing.T) {
}

func TestAddUnreleased(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
testChangelog.AddUnreleased([]string{"test"})

unreleased := testChangelog.GetUnreleased()
Expand All @@ -97,7 +97,7 @@ func TestAddUnreleased(t *testing.T) {
}

func TestGetEntries(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
for _, e := range entries {
err := e.Append("added", "test")
assert.Nil(t, err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/entry/entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestNewEntry(t *testing.T) {
}

func TestPrevious(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
entries := []entry.Entry{
{
Tag: "v2.0.0",
Expand All @@ -48,7 +48,7 @@ func TestPrevious(t *testing.T) {
}

func TestNext(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
entries := []entry.Entry{
{
Tag: "v2.0.0",
Expand Down