Skip to content

Commit

Permalink
Apply fixes from pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wjdp committed Aug 18, 2023
1 parent 4c6cf79 commit 658a7f4
Show file tree
Hide file tree
Showing 21 changed files with 49 additions and 28 deletions.
3 changes: 2 additions & 1 deletion htmldoc/attr.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package htmldoc

import (
"golang.org/x/net/html"
"strings"

"golang.org/x/net/html"
)

// GetAttr : From attrs extract single attr
Expand Down
5 changes: 3 additions & 2 deletions htmldoc/attr_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package htmldoc

import (
"github.com/daviddengcn/go-assert"
"golang.org/x/net/html"
"strings"
"testing"

"github.com/daviddengcn/go-assert"
"golang.org/x/net/html"
)

func TestGetAttr(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion htmldoc/document_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package htmldoc

import (
"github.com/daviddengcn/go-assert"
"sync"
"testing"

"github.com/daviddengcn/go-assert"
)

func TestDocumentParse(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions htmldoc/reference_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package htmldoc

import (
"github.com/daviddengcn/go-assert"
"golang.org/x/net/html"
"strings"
"testing"

"github.com/daviddengcn/go-assert"
"golang.org/x/net/html"
)

func nodeGen(snip string) (*html.Node, *html.Node) {
Expand Down
1 change: 1 addition & 0 deletions htmltest/check-doctype.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package htmltest

import (
"fmt"

"github.com/wjdp/htmltest/htmldoc"
"github.com/wjdp/htmltest/issues"
)
Expand Down
3 changes: 2 additions & 1 deletion htmltest/check-img.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package htmltest

import (
"fmt"
"regexp"

"github.com/wjdp/htmltest/htmldoc"
"github.com/wjdp/htmltest/issues"
"golang.org/x/net/html"
"regexp"
)

func (hT *HTMLTest) checkImg(document *htmldoc.Document, node *html.Node) {
Expand Down
5 changes: 3 additions & 2 deletions htmltest/check-link.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ import (
)

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

func (hT *HTMLTest) checkLink(document *htmldoc.Document, node *html.Node) {
Expand Down
3 changes: 2 additions & 1 deletion htmltest/check-meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package htmltest

import (
"fmt"
"regexp"

"github.com/wjdp/htmltest/htmldoc"
"github.com/wjdp/htmltest/issues"
"golang.org/x/net/html"
"regexp"
)

func (hT *HTMLTest) checkMeta(document *htmldoc.Document, node *html.Node) {
Expand Down
1 change: 1 addition & 0 deletions htmltest/check-script.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package htmltest

import (
"fmt"

"github.com/wjdp/htmltest/htmldoc"
"github.com/wjdp/htmltest/issues"
"golang.org/x/net/html"
Expand Down
3 changes: 2 additions & 1 deletion htmltest/external_benchmark_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package htmltest

import (
"github.com/wjdp/htmltest/issues"
"testing"

"github.com/wjdp/htmltest/issues"
)

func BenchmarkExternal(b *testing.B) {
Expand Down
3 changes: 2 additions & 1 deletion htmltest/htmltest_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package htmltest

import (
"github.com/daviddengcn/go-assert"
"testing"

"github.com/daviddengcn/go-assert"
)

func TestMissingOptions(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions htmltest/test_helpers_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package htmltest

import (
"path"
"testing"

"github.com/imdario/mergo"
"github.com/wjdp/htmltest/issues"
"github.com/wjdp/htmltest/output"
"path"
"testing"
)

// Keep it quiet
Expand Down
1 change: 1 addition & 0 deletions issues/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package issues

import (
"fmt"

"github.com/fatih/color"
"github.com/wjdp/htmltest/htmldoc"
)
Expand Down
7 changes: 4 additions & 3 deletions issues/issue_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package issues

import (
"fmt"
"github.com/fatih/color"
"github.com/wjdp/htmltest/htmldoc"
"github.com/wjdp/htmltest/output"
"io/ioutil"
"strings"
"sync"

"github.com/fatih/color"
"github.com/wjdp/htmltest/htmldoc"
"github.com/wjdp/htmltest/output"
)

// IssueStore : store of htmltest issues.
Expand Down
5 changes: 3 additions & 2 deletions issues/issue_store_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package issues

import (
"github.com/daviddengcn/go-assert"
"github.com/wjdp/htmltest/htmldoc"
"io/ioutil"
"os"
"strings"
"testing"

"github.com/daviddengcn/go-assert"
"github.com/wjdp/htmltest/htmldoc"
)

func TestIssueStoreNew(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion issues/issue_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package issues

import (
"testing"

"github.com/daviddengcn/go-assert"
"github.com/wjdp/htmltest/htmldoc"
"testing"
)

func TestIssuePrimary(t *testing.T) {
Expand Down
11 changes: 6 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ package main

import (
"fmt"
"github.com/docopt/docopt-go"
"github.com/fatih/color"
"github.com/wjdp/htmltest/htmltest"
"github.com/wjdp/htmltest/output"
"gopkg.in/yaml.v2"
"io/ioutil"
"os"
"path"
"strconv"
"strings"
"time"

"github.com/docopt/docopt-go"
"github.com/fatih/color"
"github.com/wjdp/htmltest/htmltest"
"github.com/wjdp/htmltest/output"
"gopkg.in/yaml.v2"
)

const cmdSeparator string = "========================================================================"
Expand Down
3 changes: 2 additions & 1 deletion output/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package output

import (
"fmt"
"github.com/fatih/color"
"os"

"github.com/fatih/color"
)

// CheckErrorGeneric aborts if error present with its message.
Expand Down
1 change: 1 addition & 0 deletions output/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package output

import (
"fmt"

"github.com/fatih/color"
)

Expand Down
3 changes: 2 additions & 1 deletion refcache/refcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package refcache

import (
"encoding/json"
"github.com/wjdp/htmltest/output"
"os"
"path"
"sync"
"time"

"github.com/wjdp/htmltest/output"
)

// RefCache struct : store of cached references.
Expand Down
3 changes: 2 additions & 1 deletion refcache/refcache_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package refcache

import (
"github.com/daviddengcn/go-assert"
"testing"
"time"

"github.com/daviddengcn/go-assert"
)

func TestRefCacheNew(t *testing.T) {
Expand Down

0 comments on commit 658a7f4

Please sign in to comment.