Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fixes from pre-commit #220

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading