summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorThomas Boerger <thomas@webhippie.de>2016-11-25 10:08:23 +0100
committerGitHub <noreply@github.com>2016-11-25 10:08:23 +0100
commit7c5de1e39303c52724e732934b1d78133209d854 (patch)
tree4e635955d8b98ebadfa89ce5f792475bf7117d3a /models
parenta321ffbccef536a01d02869d7ba7b1f536a1afb3 (diff)
parent76604d8f9008dd4e42500a6febd09475483d4057 (diff)
downloadgitea-7c5de1e39303c52724e732934b1d78133209d854.tar.gz
gitea-7c5de1e39303c52724e732934b1d78133209d854.zip
Merge pull request #250 from lunny/lunny/golint_modules_markdown
Golint fixed for modules/markdown
Diffstat (limited to 'models')
-rw-r--r--models/repo.go8
-rw-r--r--models/repo_test.go12
2 files changed, 10 insertions, 10 deletions
diff --git a/models/repo.go b/models/repo.go
index 20671cb019..b3e08a93e8 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -224,7 +224,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 = markdown.ISSUE_NAME_STYLE_NUMERIC
+ repo.ExternalTrackerStyle = markdown.IssueNameStyleNumeric
}
case "created_unix":
repo.Created = time.Unix(repo.CreatedUnix, 0).Local()
@@ -310,10 +310,10 @@ func (repo *Repository) ComposeMetas() map[string]string {
"repo": repo.Name,
}
switch repo.ExternalTrackerStyle {
- case markdown.ISSUE_NAME_STYLE_ALPHANUMERIC:
- repo.ExternalMetas["style"] = markdown.ISSUE_NAME_STYLE_ALPHANUMERIC
+ case markdown.IssueNameStyleAlphanumeric:
+ repo.ExternalMetas["style"] = markdown.IssueNameStyleAlphanumeric
default:
- repo.ExternalMetas["style"] = markdown.ISSUE_NAME_STYLE_NUMERIC
+ repo.ExternalMetas["style"] = markdown.IssueNameStyleNumeric
}
}
diff --git a/models/repo_test.go b/models/repo_test.go
index fdf3a07baf..70ad1c1f0e 100644
--- a/models/repo_test.go
+++ b/models/repo_test.go
@@ -24,7 +24,7 @@ func TestRepo(t *testing.T) {
Convey("It should be nil even if other settings are present", func() {
repo.EnableExternalTracker = false
repo.ExternalTrackerFormat = "http://someurl.com/{user}/{repo}/{issue}"
- repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_NUMERIC
+ repo.ExternalTrackerStyle = markdown.IssueNameStyleNumeric
So(repo.ComposeMetas(), ShouldEqual, map[string]string(nil))
})
})
@@ -33,17 +33,17 @@ func TestRepo(t *testing.T) {
repo.EnableExternalTracker = true
Convey("It should default to numeric issue style", func() {
metas := repo.ComposeMetas()
- So(metas["style"], ShouldEqual, markdown.ISSUE_NAME_STYLE_NUMERIC)
+ So(metas["style"], ShouldEqual, markdown.IssueNameStyleNumeric)
})
Convey("It should pass through numeric issue style setting", func() {
- repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_NUMERIC
+ repo.ExternalTrackerStyle = markdown.IssueNameStyleNumeric
metas := repo.ComposeMetas()
- So(metas["style"], ShouldEqual, markdown.ISSUE_NAME_STYLE_NUMERIC)
+ So(metas["style"], ShouldEqual, markdown.IssueNameStyleNumeric)
})
Convey("It should pass through alphanumeric issue style setting", func() {
- repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_ALPHANUMERIC
+ repo.ExternalTrackerStyle = markdown.IssueNameStyleAlphanumeric
metas := repo.ComposeMetas()
- So(metas["style"], ShouldEqual, markdown.ISSUE_NAME_STYLE_ALPHANUMERIC)
+ So(metas["style"], ShouldEqual, markdown.IssueNameStyleAlphanumeric)
})
Convey("It should contain the user name", func() {
metas := repo.ComposeMetas()