summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-12-02 13:23:25 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-12-03 13:12:58 +0100
commitd90e37e0c6e812f9913bf256c9c81aa05b7a08aa (patch)
tree7b1b14464eefec1188ca2eed53c64e4823453cc9 /source
parent32471b57bde51c55a15dbf1db75d6e5f7232c347 (diff)
all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
Diffstat (limited to 'source')
-rw-r--r--source/fileInfo.go2
-rw-r--r--source/fileInfo_test.go4
-rw-r--r--source/filesystem.go2
-rw-r--r--source/filesystem_test.go1
-rw-r--r--source/sourceSpec.go1
5 files changed, 0 insertions, 10 deletions
diff --git a/source/fileInfo.go b/source/fileInfo.go
index 849afa45e..4e7866315 100644
--- a/source/fileInfo.go
+++ b/source/fileInfo.go
@@ -232,7 +232,6 @@ func (sp *SourceSpec) NewFileInfoFrom(path, filename string) (*FileInfo, error)
}
func (sp *SourceSpec) NewFileInfo(fi hugofs.FileMetaInfo) (*FileInfo, error) {
-
m := fi.Meta()
filename := m.Filename()
@@ -290,5 +289,4 @@ func (sp *SourceSpec) NewFileInfo(fi hugofs.FileMetaInfo) (*FileInfo, error) {
}
return f, nil
-
}
diff --git a/source/fileInfo_test.go b/source/fileInfo_test.go
index 1c9da7e41..b8bb33cd3 100644
--- a/source/fileInfo_test.go
+++ b/source/fileInfo_test.go
@@ -38,18 +38,15 @@ func TestFileInfo(t *testing.T) {
c.Assert(f.Section(), qt.Equals, "b")
c.Assert(f.TranslationBaseName(), qt.Equals, filepath.FromSlash("page"))
c.Assert(f.BaseFileName(), qt.Equals, filepath.FromSlash("page"))
-
}},
{filepath.FromSlash("/a/"), filepath.FromSlash("/a/b/c/d/page.md"), func(f *FileInfo) {
c.Assert(f.Section(), qt.Equals, "b")
-
}},
{filepath.FromSlash("/a/"), filepath.FromSlash("/a/b/page.en.MD"), func(f *FileInfo) {
c.Assert(f.Section(), qt.Equals, "b")
c.Assert(f.Path(), qt.Equals, filepath.FromSlash("b/page.en.MD"))
c.Assert(f.TranslationBaseName(), qt.Equals, filepath.FromSlash("page"))
c.Assert(f.BaseFileName(), qt.Equals, filepath.FromSlash("page.en"))
-
}},
} {
path := strings.TrimPrefix(this.filename, this.base)
@@ -57,5 +54,4 @@ func TestFileInfo(t *testing.T) {
c.Assert(err, qt.IsNil)
this.assert(f)
}
-
}
diff --git a/source/filesystem.go b/source/filesystem.go
index ce62c15a4..1cd75f032 100644
--- a/source/filesystem.go
+++ b/source/filesystem.go
@@ -102,11 +102,9 @@ func (f *Filesystem) captureFiles() error {
})
return w.Walk()
-
}
func (f *Filesystem) shouldRead(filename string, fi hugofs.FileMetaInfo) (bool, error) {
-
ignore := f.SourceSpec.IgnoreFile(fi.Meta().Filename())
if fi.IsDir() {
diff --git a/source/filesystem_test.go b/source/filesystem_test.go
index ec7a305dc..5dc187978 100644
--- a/source/filesystem_test.go
+++ b/source/filesystem_test.go
@@ -74,7 +74,6 @@ func TestUnicodeNorm(t *testing.T) {
t.Fatalf("file %q name in NFD form should be normalized (%s)", f.BaseFileName(), path.NFC)
}
}
-
}
func newTestConfig() *viper.Viper {
diff --git a/source/sourceSpec.go b/source/sourceSpec.go
index 504a3a22d..e8407a14d 100644
--- a/source/sourceSpec.go
+++ b/source/sourceSpec.go
@@ -74,7 +74,6 @@ func NewSourceSpec(ps *helpers.PathSpec, fs afero.Fs) *SourceSpec {
}
return &SourceSpec{ignoreFilesRe: regexps, PathSpec: ps, SourceFs: fs, Languages: languages, DefaultContentLanguage: defaultLang, DisabledLanguages: disabledLangsSet}
-
}
// IgnoreFile returns whether a given file should be ignored.