diff options
author | Joe Chen <jc@unknwon.io> | 2022-01-13 11:27:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 11:27:16 +0800 |
commit | 9ae80a6173132c54fb0fb9f094b3e472a10e1f3f (patch) | |
tree | 4ba9fd4de2fbba3a986a772e337ce71be9845636 /internal/db | |
parent | c8476b1c2e5dc8e430713722daa0bc4ba5e07103 (diff) |
chore: rename few consts to camel case (#6725)
Diffstat (limited to 'internal/db')
-rw-r--r-- | internal/db/repo.go | 8 | ||||
-rw-r--r-- | internal/db/repo_test.go | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/internal/db/repo.go b/internal/db/repo.go index 1165912b..f4a9f0ff 100644 --- a/internal/db/repo.go +++ b/internal/db/repo.go @@ -228,7 +228,7 @@ func (repo *Repository) AfterSet(colName string, _ xorm.Cell) { repo.NumOpenMilestones = repo.NumMilestones - repo.NumClosedMilestones case "external_tracker_style": if len(repo.ExternalTrackerStyle) == 0 { - repo.ExternalTrackerStyle = markup.ISSUE_NAME_STYLE_NUMERIC + repo.ExternalTrackerStyle = markup.IssueNameStyleNumeric } case "created_unix": repo.Created = time.Unix(repo.CreatedUnix, 0).Local() @@ -445,10 +445,10 @@ func (repo *Repository) ComposeMetas() map[string]string { repo.ExternalMetas["format"] = repo.ExternalTrackerFormat switch repo.ExternalTrackerStyle { - case markup.ISSUE_NAME_STYLE_ALPHANUMERIC: - repo.ExternalMetas["style"] = markup.ISSUE_NAME_STYLE_ALPHANUMERIC + case markup.IssueNameStyleAlphanumeric: + repo.ExternalMetas["style"] = markup.IssueNameStyleAlphanumeric default: - repo.ExternalMetas["style"] = markup.ISSUE_NAME_STYLE_NUMERIC + repo.ExternalMetas["style"] = markup.IssueNameStyleNumeric } } diff --git a/internal/db/repo_test.go b/internal/db/repo_test.go index ad920be7..32caf6a2 100644 --- a/internal/db/repo_test.go +++ b/internal/db/repo_test.go @@ -35,15 +35,15 @@ func TestRepository_ComposeMetas(t *testing.T) { repo.EnableExternalTracker = true // Default to numeric issue style - assert.Equal(t, markup.ISSUE_NAME_STYLE_NUMERIC, repo.ComposeMetas()["style"]) + assert.Equal(t, markup.IssueNameStyleNumeric, repo.ComposeMetas()["style"]) repo.ExternalMetas = nil - repo.ExternalTrackerStyle = markup.ISSUE_NAME_STYLE_NUMERIC - assert.Equal(t, markup.ISSUE_NAME_STYLE_NUMERIC, repo.ComposeMetas()["style"]) + repo.ExternalTrackerStyle = markup.IssueNameStyleNumeric + assert.Equal(t, markup.IssueNameStyleNumeric, repo.ComposeMetas()["style"]) repo.ExternalMetas = nil - repo.ExternalTrackerStyle = markup.ISSUE_NAME_STYLE_ALPHANUMERIC - assert.Equal(t, markup.ISSUE_NAME_STYLE_ALPHANUMERIC, repo.ComposeMetas()["style"]) + repo.ExternalTrackerStyle = markup.IssueNameStyleAlphanumeric + assert.Equal(t, markup.IssueNameStyleAlphanumeric, repo.ComposeMetas()["style"]) repo.ExternalMetas = nil metas := repo.ComposeMetas() |