mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
all: Run gofumpt -l -w .
This commit is contained in:
@@ -50,7 +50,6 @@ func ColorToHexString(c color.Color) string {
|
||||
r, g, b, a := c.RGBA()
|
||||
rgba := color.RGBA{uint8(r), uint8(g), uint8(b), uint8(a)}
|
||||
return fmt.Sprintf("#%.2x%.2x%.2x", rgba.R, rgba.G, rgba.B)
|
||||
|
||||
}
|
||||
|
||||
func hexStringToColor(s string) (color.Color, error) {
|
||||
|
@@ -28,8 +28,7 @@ func TestPageMatcher(t *testing.T) {
|
||||
developmentTestSite := testSite{h: hugo.NewInfo(testConfig{environment: "development"}, nil)}
|
||||
productionTestSite := testSite{h: hugo.NewInfo(testConfig{environment: "production"}, nil)}
|
||||
|
||||
p1, p2, p3 :=
|
||||
&testPage{path: "/p1", kind: "section", lang: "en", site: developmentTestSite},
|
||||
p1, p2, p3 := &testPage{path: "/p1", kind: "section", lang: "en", site: developmentTestSite},
|
||||
&testPage{path: "p2", kind: "page", lang: "no", site: productionTestSite},
|
||||
&testPage{path: "p3", kind: "page", lang: "en"}
|
||||
|
||||
@@ -154,7 +153,6 @@ func TestDecodeCascadeConfig(t *testing.T) {
|
||||
got, err = DecodeCascadeConfig(nil)
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(got, qt.IsNotNil)
|
||||
|
||||
}
|
||||
|
||||
type testConfig struct {
|
||||
|
@@ -81,7 +81,6 @@ func TestDecodeRemoteOptions(t *testing.T) {
|
||||
c.Assert(err, isErr)
|
||||
c.Assert(got, qt.DeepEquals, test.want)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +113,6 @@ func TestOptionsNewRequest(t *testing.T) {
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(req.Method, qt.Equals, "GET")
|
||||
c.Assert(req.Header["User-Agent"], qt.DeepEquals, []string{"foo"})
|
||||
|
||||
}
|
||||
|
||||
func TestCalculateResourceID(t *testing.T) {
|
||||
|
@@ -293,7 +293,6 @@ T1: {{ $r.Content }}
|
||||
|
||||
b.AssertLogMatches(`Dart Sass: foo`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:1:0: bar`)
|
||||
|
||||
}
|
||||
|
||||
func TestTransformErrors(t *testing.T) {
|
||||
@@ -347,7 +346,6 @@ T1: {{ $r.Content }}
|
||||
b.Assert(fe.ErrorContext(), qt.IsNotNil)
|
||||
b.Assert(fe.ErrorContext().Lines, qt.DeepEquals, []string{" $maincolor #eee;", "", "body {", "\tcolor: $maincolor;", "}"})
|
||||
b.Assert(fe.ErrorContext().ChromaLexer, qt.Equals, "scss")
|
||||
|
||||
})
|
||||
|
||||
c.Run("error in import", func(c *qt.C) {
|
||||
@@ -365,9 +363,7 @@ T1: {{ $r.Content }}
|
||||
b.Assert(fe.ErrorContext(), qt.IsNotNil)
|
||||
b.Assert(fe.ErrorContext().Lines, qt.DeepEquals, []string{"/* comment line 1 */", "$foocolor #ccc;", "", "foo {"})
|
||||
b.Assert(fe.ErrorContext().ChromaLexer, qt.Equals, "scss")
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
func TestOptionVars(t *testing.T) {
|
||||
@@ -528,5 +524,4 @@ T1: {{ $r.Content }}
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:12:0: number`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:13:0: number`)
|
||||
b.AssertLogMatches(`Dart Sass: .*assets.*main.scss:14:0: number`)
|
||||
|
||||
}
|
||||
|
@@ -47,7 +47,6 @@ func (c *Client) ToCSS(res resources.ResourceTransformer, opts Options) (resourc
|
||||
}
|
||||
|
||||
return res.Transform(&toCSSTransformation{c: c, options: internalOptions})
|
||||
|
||||
}
|
||||
|
||||
type toCSSTransformation struct {
|
||||
|
@@ -228,7 +228,6 @@ T1: {{ $r.Content }}
|
||||
b.Assert(fe.ErrorContext(), qt.IsNotNil)
|
||||
b.Assert(fe.ErrorContext().Lines, qt.DeepEquals, []string{"/* comment line 4 */", "", "$maincolor #eee;", "", "body {"})
|
||||
b.Assert(fe.ErrorContext().ChromaLexer, qt.Equals, "scss")
|
||||
|
||||
})
|
||||
|
||||
c.Run("error in import", func(c *qt.C) {
|
||||
@@ -245,9 +244,7 @@ T1: {{ $r.Content }}
|
||||
b.Assert(fe.ErrorContext(), qt.IsNotNil)
|
||||
b.Assert(fe.ErrorContext().Lines, qt.DeepEquals, []string{"/* comment line 1 */", "$foocolor #ccc;", "", "foo {"})
|
||||
b.Assert(fe.ErrorContext().ChromaLexer, qt.Equals, "scss")
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
func TestOptionVars(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user