Skip to content

Commit 658a7f4

Browse files
committedAug 18, 2023
Apply fixes from pre-commit
1 parent 4c6cf79 commit 658a7f4

21 files changed

+49
-28
lines changed
 

‎htmldoc/attr.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package htmldoc
22

33
import (
4-
"golang.org/x/net/html"
54
"strings"
5+
6+
"golang.org/x/net/html"
67
)
78

89
// GetAttr : From attrs extract single attr

‎htmldoc/attr_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package htmldoc
22

33
import (
4-
"github.com/daviddengcn/go-assert"
5-
"golang.org/x/net/html"
64
"strings"
75
"testing"
6+
7+
"github.com/daviddengcn/go-assert"
8+
"golang.org/x/net/html"
89
)
910

1011
func TestGetAttr(t *testing.T) {

‎htmldoc/document_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package htmldoc
22

33
import (
4-
"github.com/daviddengcn/go-assert"
54
"sync"
65
"testing"
6+
7+
"github.com/daviddengcn/go-assert"
78
)
89

910
func TestDocumentParse(t *testing.T) {

‎htmldoc/reference_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package htmldoc
22

33
import (
4-
"github.com/daviddengcn/go-assert"
5-
"golang.org/x/net/html"
64
"strings"
75
"testing"
6+
7+
"github.com/daviddengcn/go-assert"
8+
"golang.org/x/net/html"
89
)
910

1011
func nodeGen(snip string) (*html.Node, *html.Node) {

‎htmltest/check-doctype.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package htmltest
22

33
import (
44
"fmt"
5+
56
"github.com/wjdp/htmltest/htmldoc"
67
"github.com/wjdp/htmltest/issues"
78
)

‎htmltest/check-img.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ package htmltest
22

33
import (
44
"fmt"
5+
"regexp"
6+
57
"github.com/wjdp/htmltest/htmldoc"
68
"github.com/wjdp/htmltest/issues"
79
"golang.org/x/net/html"
8-
"regexp"
910
)
1011

1112
func (hT *HTMLTest) checkImg(document *htmldoc.Document, node *html.Node) {

‎htmltest/check-link.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ import (
1717
)
1818

1919
// ignoredRels: List of rel values to ignore, dns-prefetch and preconnect are ignored as they are not links to be
20-
// followed rather telling browser we want something on that host, if the root of that host is not valid,
21-
// it's likely not a problem.
20+
//
21+
// followed rather telling browser we want something on that host, if the root of that host is not valid,
22+
// it's likely not a problem.
2223
var ignoredRels = [...]string{"dns-prefetch", "preconnect"}
2324

2425
func (hT *HTMLTest) checkLink(document *htmldoc.Document, node *html.Node) {

‎htmltest/check-meta.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ package htmltest
22

33
import (
44
"fmt"
5+
"regexp"
6+
57
"github.com/wjdp/htmltest/htmldoc"
68
"github.com/wjdp/htmltest/issues"
79
"golang.org/x/net/html"
8-
"regexp"
910
)
1011

1112
func (hT *HTMLTest) checkMeta(document *htmldoc.Document, node *html.Node) {

‎htmltest/check-script.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package htmltest
22

33
import (
44
"fmt"
5+
56
"github.com/wjdp/htmltest/htmldoc"
67
"github.com/wjdp/htmltest/issues"
78
"golang.org/x/net/html"

‎htmltest/external_benchmark_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package htmltest
22

33
import (
4-
"github.com/wjdp/htmltest/issues"
54
"testing"
5+
6+
"github.com/wjdp/htmltest/issues"
67
)
78

89
func BenchmarkExternal(b *testing.B) {

‎htmltest/htmltest_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package htmltest
22

33
import (
4-
"github.com/daviddengcn/go-assert"
54
"testing"
5+
6+
"github.com/daviddengcn/go-assert"
67
)
78

89
func TestMissingOptions(t *testing.T) {

‎htmltest/test_helpers_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package htmltest
22

33
import (
4+
"path"
5+
"testing"
6+
47
"github.com/imdario/mergo"
58
"github.com/wjdp/htmltest/issues"
69
"github.com/wjdp/htmltest/output"
7-
"path"
8-
"testing"
910
)
1011

1112
// Keep it quiet

‎issues/issue.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package issues
22

33
import (
44
"fmt"
5+
56
"github.com/fatih/color"
67
"github.com/wjdp/htmltest/htmldoc"
78
)

‎issues/issue_store.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package issues
33

44
import (
55
"fmt"
6-
"github.com/fatih/color"
7-
"github.com/wjdp/htmltest/htmldoc"
8-
"github.com/wjdp/htmltest/output"
96
"io/ioutil"
107
"strings"
118
"sync"
9+
10+
"github.com/fatih/color"
11+
"github.com/wjdp/htmltest/htmldoc"
12+
"github.com/wjdp/htmltest/output"
1213
)
1314

1415
// IssueStore : store of htmltest issues.

‎issues/issue_store_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package issues
22

33
import (
4-
"github.com/daviddengcn/go-assert"
5-
"github.com/wjdp/htmltest/htmldoc"
64
"io/ioutil"
75
"os"
86
"strings"
97
"testing"
8+
9+
"github.com/daviddengcn/go-assert"
10+
"github.com/wjdp/htmltest/htmldoc"
1011
)
1112

1213
func TestIssueStoreNew(t *testing.T) {

‎issues/issue_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package issues
22

33
import (
4+
"testing"
5+
46
"github.com/daviddengcn/go-assert"
57
"github.com/wjdp/htmltest/htmldoc"
6-
"testing"
78
)
89

910
func TestIssuePrimary(t *testing.T) {

‎main.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ package main
33

44
import (
55
"fmt"
6-
"github.com/docopt/docopt-go"
7-
"github.com/fatih/color"
8-
"github.com/wjdp/htmltest/htmltest"
9-
"github.com/wjdp/htmltest/output"
10-
"gopkg.in/yaml.v2"
116
"io/ioutil"
127
"os"
138
"path"
149
"strconv"
1510
"strings"
1611
"time"
12+
13+
"github.com/docopt/docopt-go"
14+
"github.com/fatih/color"
15+
"github.com/wjdp/htmltest/htmltest"
16+
"github.com/wjdp/htmltest/output"
17+
"gopkg.in/yaml.v2"
1718
)
1819

1920
const cmdSeparator string = "========================================================================"

‎output/error.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ package output
22

33
import (
44
"fmt"
5-
"github.com/fatih/color"
65
"os"
6+
7+
"github.com/fatih/color"
78
)
89

910
// CheckErrorGeneric aborts if error present with its message.

‎output/print.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package output
22

33
import (
44
"fmt"
5+
56
"github.com/fatih/color"
67
)
78

‎refcache/refcache.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ package refcache
33

44
import (
55
"encoding/json"
6-
"github.com/wjdp/htmltest/output"
76
"os"
87
"path"
98
"sync"
109
"time"
10+
11+
"github.com/wjdp/htmltest/output"
1112
)
1213

1314
// RefCache struct : store of cached references.

‎refcache/refcache_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package refcache
22

33
import (
4-
"github.com/daviddengcn/go-assert"
54
"testing"
65
"time"
6+
7+
"github.com/daviddengcn/go-assert"
78
)
89

910
func TestRefCacheNew(t *testing.T) {

0 commit comments

Comments
 (0)
Please sign in to comment.