aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2022-02-27 19:40:07 +0100
committerBjørn Erik Pedersen <[email protected]>2022-02-27 19:40:07 +0100
commitcff14144a6306b9a60c4fc56d1dce17f0b3778e9 (patch)
treed25c152573d265ffd548e7acf628d51bbed61332
parent5f671515504b56d7d1906fa2d17e72de49d84437 (diff)
downloadhugo-cff14144a6306b9a60c4fc56d1dce17f0b3778e9.tar.gz
hugo-cff14144a6306b9a60c4fc56d1dce17f0b3778e9.zip
Rename Codeowners() to CodeOwners()
-rw-r--r--hugolib/codeowners.go6
-rw-r--r--hugolib/hugo_sites.go2
-rw-r--r--hugolib/page.go2
-rw-r--r--hugolib/page_test.go4
-rw-r--r--resources/page/page.go2
-rw-r--r--resources/page/page_nop.go2
-rw-r--r--resources/page/testhelpers_test.go2
7 files changed, 10 insertions, 10 deletions
diff --git a/hugolib/codeowners.go b/hugolib/codeowners.go
index 77068f1eb..17e956981 100644
--- a/hugolib/codeowners.go
+++ b/hugolib/codeowners.go
@@ -26,7 +26,7 @@ import (
var afs = afero.NewOsFs()
-func findCodeownersFile(dir string) (io.Reader, error) {
+func findCodeOwnersFile(dir string) (io.Reader, error) {
for _, p := range []string{".", "docs", ".github", ".gitlab"} {
f := path.Join(dir, p, "CODEOWNERS")
@@ -52,10 +52,10 @@ func (c *codeownerInfo) forPage(p page.Page) []string {
return c.owners.Owners(p.File().Filename())
}
-func newCodeowners(cfg config.Provider) (*codeownerInfo, error) {
+func newCodeOwners(cfg config.Provider) (*codeownerInfo, error) {
workingDir := cfg.GetString("workingDir")
- r, err := findCodeownersFile(workingDir)
+ r, err := findCodeOwnersFile(workingDir)
if err != nil || r == nil {
return nil, err
}
diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go
index 662ba19d3..9d577a285 100644
--- a/hugolib/hugo_sites.go
+++ b/hugolib/hugo_sites.go
@@ -431,7 +431,7 @@ func (h *HugoSites) loadGitInfo() error {
h.gitInfo = gi
}
- co, err := newCodeowners(h.Cfg)
+ co, err := newCodeOwners(h.Cfg)
if err != nil {
h.Log.Errorln("Failed to read CODEOWNERS:", err)
} else {
diff --git a/hugolib/page.go b/hugolib/page.go
index 7101af814..175e1fc3b 100644
--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -156,7 +156,7 @@ func (p *pageState) GitInfo() *gitmap.GitInfo {
return p.gitInfo
}
-func (p *pageState) Codeowners() []string {
+func (p *pageState) CodeOwners() []string {
return p.codeowners
}
diff --git a/hugolib/page_test.go b/hugolib/page_test.go
index 04ca696c8..637ac46f7 100644
--- a/hugolib/page_test.go
+++ b/hugolib/page_test.go
@@ -1074,14 +1074,14 @@ func TestPageWithLastmodFromGitInfo(t *testing.T) {
// 2018-03-11 is the Git author date for testsite/content/first-post.md
c.Assert(enSite.RegularPages()[0].Lastmod().Format("2006-01-02"), qt.Equals, "2018-03-11")
- c.Assert(enSite.RegularPages()[0].Codeowners()[0], qt.Equals, "@bep")
+ c.Assert(enSite.RegularPages()[0].CodeOwners()[0], qt.Equals, "@bep")
nnSite := h.Sites[1]
c.Assert(len(nnSite.RegularPages()), qt.Equals, 1)
// 2018-08-11 is the Git author date for testsite/content_nn/first-post.md
c.Assert(nnSite.RegularPages()[0].Lastmod().Format("2006-01-02"), qt.Equals, "2018-08-11")
- c.Assert(enSite.RegularPages()[0].Codeowners()[0], qt.Equals, "@bep")
+ c.Assert(enSite.RegularPages()[0].CodeOwners()[0], qt.Equals, "@bep")
}
func TestPageWithFrontMatterConfig(t *testing.T) {
diff --git a/resources/page/page.go b/resources/page/page.go
index 797322717..d68694937 100644
--- a/resources/page/page.go
+++ b/resources/page/page.go
@@ -107,7 +107,7 @@ type GetPageProvider interface {
// GitInfoProvider provides Git info.
type GitInfoProvider interface {
GitInfo() *gitmap.GitInfo
- Codeowners() []string
+ CodeOwners() []string
}
// InSectionPositioner provides section navigation.
diff --git a/resources/page/page_nop.go b/resources/page/page_nop.go
index 641c34d41..52345ad71 100644
--- a/resources/page/page_nop.go
+++ b/resources/page/page_nop.go
@@ -194,7 +194,7 @@ func (p *nopPage) GitInfo() *gitmap.GitInfo {
return nil
}
-func (p *nopPage) Codeowners() []string {
+func (p *nopPage) CodeOwners() []string {
return nil
}
diff --git a/resources/page/testhelpers_test.go b/resources/page/testhelpers_test.go
index 1aa80e2bb..a655d3da9 100644
--- a/resources/page/testhelpers_test.go
+++ b/resources/page/testhelpers_test.go
@@ -252,7 +252,7 @@ func (p *testPage) GitInfo() *gitmap.GitInfo {
return nil
}
-func (p *testPage) Codeowners() []string {
+func (p *testPage) CodeOwners() []string {
return nil
}