mirror of
https://github.com/mgechev/revive.git
synced 2025-11-23 22:04:49 +02:00
Refactor
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
golinter
|
||||
revive
|
||||
vendor
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"go/ast"
|
||||
"go/token"
|
||||
|
||||
"github.com/mgechev/golinter/file"
|
||||
"github.com/mgechev/golinter/rules"
|
||||
"github.com/mgechev/golinter/visitors"
|
||||
"github.com/mgechev/revive/file"
|
||||
"github.com/mgechev/revive/rules"
|
||||
"github.com/mgechev/revive/visitors"
|
||||
)
|
||||
|
||||
const ruleName = "no-else-return"
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/mgechev/golinter/rules"
|
||||
"github.com/mgechev/revive/rules"
|
||||
"github.com/olekukonko/tablewriter"
|
||||
"github.com/ttacon/chalk"
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package formatters
|
||||
|
||||
import "github.com/mgechev/golinter/rules"
|
||||
import "github.com/mgechev/revive/rules"
|
||||
|
||||
// FormatterMetadata configuration of a formatter
|
||||
type FormatterMetadata struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package formatters
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mgechev/golinter/rules"
|
||||
"github.com/mgechev/revive/rules"
|
||||
)
|
||||
|
||||
// JSONFormatter is an implementation of the Formatter interface
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package: github.com/mgechev/golinter
|
||||
package: github.com/mgechev/revive
|
||||
import:
|
||||
- package: github.com/ttacon/chalk
|
||||
version: ~0.1.0
|
||||
|
||||
@@ -3,8 +3,8 @@ package linter
|
||||
import (
|
||||
"go/token"
|
||||
|
||||
"github.com/mgechev/golinter/file"
|
||||
"github.com/mgechev/golinter/rules"
|
||||
"github.com/mgechev/revive/file"
|
||||
"github.com/mgechev/revive/rules"
|
||||
)
|
||||
|
||||
// ReadFile defines an abstraction for reading files.
|
||||
|
||||
8
main.go
8
main.go
@@ -3,10 +3,10 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/mgechev/golinter/defaultrules"
|
||||
"github.com/mgechev/golinter/formatters"
|
||||
"github.com/mgechev/golinter/linter"
|
||||
"github.com/mgechev/golinter/rules"
|
||||
"github.com/mgechev/revive/defaultrules"
|
||||
"github.com/mgechev/revive/formatters"
|
||||
"github.com/mgechev/revive/linter"
|
||||
"github.com/mgechev/revive/rules"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -3,7 +3,7 @@ package rules
|
||||
import (
|
||||
"go/token"
|
||||
|
||||
"github.com/mgechev/golinter/file"
|
||||
"github.com/mgechev/revive/file"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -3,8 +3,8 @@ package visitors
|
||||
import (
|
||||
"go/token"
|
||||
|
||||
"github.com/mgechev/golinter/file"
|
||||
"github.com/mgechev/golinter/rules"
|
||||
"github.com/mgechev/revive/file"
|
||||
"github.com/mgechev/revive/rules"
|
||||
)
|
||||
|
||||
// RuleVisitor defines a struct for a visitor.
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"errors"
|
||||
"reflect"
|
||||
|
||||
"github.com/mgechev/golinter/file"
|
||||
"github.com/mgechev/golinter/rules"
|
||||
"github.com/mgechev/revive/file"
|
||||
"github.com/mgechev/revive/rules"
|
||||
)
|
||||
|
||||
// Setup sets the proper pointers of given visitor.
|
||||
|
||||
Reference in New Issue
Block a user