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

chore: goimports settings #442

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@
"commentedOutCode",
],
},
"goimports": {
"local-prefixes": "github.com/quasilyte/go-ruleguard"
},
},
}
3 changes: 2 additions & 1 deletion analyzer/testanalyzer/testanalyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"go/token"
"path/filepath"

"golang.org/x/tools/go/analysis"

"github.com/quasilyte/go-ruleguard/ruleguard"
"github.com/quasilyte/go-ruleguard/ruleguard/ir"
"golang.org/x/tools/go/analysis"
)

func New(ruleSet *ir.File) *analysis.Analyzer {
Expand Down
4 changes: 2 additions & 2 deletions cmd/gorules/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package main

import (
"bytes"
"os"

"encoding/json"
"flag"
"fmt"
Expand All @@ -14,10 +12,12 @@ import (
"go/types"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"

"github.com/cespare/subcmd"

"github.com/quasilyte/go-ruleguard/ruleguard"
"github.com/quasilyte/go-ruleguard/ruleguard/irconv"
"github.com/quasilyte/go-ruleguard/ruleguard/irprint"
Expand Down
3 changes: 2 additions & 1 deletion cmd/ruleguard/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package main

import (
"github.com/quasilyte/go-ruleguard/analyzer"
"golang.org/x/tools/go/analysis/singlechecker"

"github.com/quasilyte/go-ruleguard/analyzer"
)

func main() {
Expand Down
3 changes: 2 additions & 1 deletion ruleguard/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ import (
"strings"
"sync"

"github.com/quasilyte/stdinfo"

"github.com/quasilyte/go-ruleguard/internal/goenv"
"github.com/quasilyte/go-ruleguard/ruleguard/ir"
"github.com/quasilyte/go-ruleguard/ruleguard/quasigo"
"github.com/quasilyte/go-ruleguard/ruleguard/quasigo/stdlib/qfmt"
"github.com/quasilyte/go-ruleguard/ruleguard/quasigo/stdlib/qstrconv"
"github.com/quasilyte/go-ruleguard/ruleguard/quasigo/stdlib/qstrings"
"github.com/quasilyte/go-ruleguard/ruleguard/typematch"
"github.com/quasilyte/stdinfo"
)

type engine struct {
Expand Down
5 changes: 3 additions & 2 deletions ruleguard/gorule.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import (
"go/types"
"regexp"

"github.com/quasilyte/go-ruleguard/ruleguard/quasigo"
"github.com/quasilyte/go-ruleguard/ruleguard/typematch"
"github.com/quasilyte/gogrep"
"github.com/quasilyte/gogrep/nodetag"

"github.com/quasilyte/go-ruleguard/ruleguard/quasigo"
"github.com/quasilyte/go-ruleguard/ruleguard/typematch"
)

type goRuleSet struct {
Expand Down
3 changes: 2 additions & 1 deletion ruleguard/quasigo/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
"go/token"
"go/types"

"github.com/quasilyte/go-ruleguard/ruleguard/goutil"
"golang.org/x/tools/go/ast/astutil"

"github.com/quasilyte/go-ruleguard/ruleguard/goutil"
)

var voidType = &types.Tuple{}
Expand Down
1 change: 1 addition & 0 deletions ruleguard/quasigo/compile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"

"github.com/google/go-cmp/cmp"

"github.com/quasilyte/go-ruleguard/ruleguard/quasigo"
)

Expand Down
1 change: 1 addition & 0 deletions ruleguard/quasigo/eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"testing"

"github.com/google/go-cmp/cmp"

"github.com/quasilyte/go-ruleguard/ruleguard/quasigo"
"github.com/quasilyte/go-ruleguard/ruleguard/quasigo/internal/evaltest"
"github.com/quasilyte/go-ruleguard/ruleguard/quasigo/stdlib/qfmt"
Expand Down
3 changes: 2 additions & 1 deletion ruleguard/ruleguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import (
"go/types"
"io"

"github.com/quasilyte/gogrep"

"github.com/quasilyte/go-ruleguard/ruleguard/ir"
"github.com/quasilyte/go-ruleguard/ruleguard/quasigo"
"github.com/quasilyte/go-ruleguard/ruleguard/typematch"
"github.com/quasilyte/gogrep"
)

// Engine is the main ruleguard package API object.
Expand Down