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
|
golinter
|
||||||
|
revive
|
||||||
vendor
|
vendor
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import (
|
|||||||
"go/ast"
|
"go/ast"
|
||||||
"go/token"
|
"go/token"
|
||||||
|
|
||||||
"github.com/mgechev/golinter/file"
|
"github.com/mgechev/revive/file"
|
||||||
"github.com/mgechev/golinter/rules"
|
"github.com/mgechev/revive/rules"
|
||||||
"github.com/mgechev/golinter/visitors"
|
"github.com/mgechev/revive/visitors"
|
||||||
)
|
)
|
||||||
|
|
||||||
const ruleName = "no-else-return"
|
const ruleName = "no-else-return"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/mgechev/golinter/rules"
|
"github.com/mgechev/revive/rules"
|
||||||
"github.com/olekukonko/tablewriter"
|
"github.com/olekukonko/tablewriter"
|
||||||
"github.com/ttacon/chalk"
|
"github.com/ttacon/chalk"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package formatters
|
package formatters
|
||||||
|
|
||||||
import "github.com/mgechev/golinter/rules"
|
import "github.com/mgechev/revive/rules"
|
||||||
|
|
||||||
// FormatterMetadata configuration of a formatter
|
// FormatterMetadata configuration of a formatter
|
||||||
type FormatterMetadata struct {
|
type FormatterMetadata struct {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package formatters
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/mgechev/golinter/rules"
|
"github.com/mgechev/revive/rules"
|
||||||
)
|
)
|
||||||
|
|
||||||
// JSONFormatter is an implementation of the Formatter interface
|
// JSONFormatter is an implementation of the Formatter interface
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package: github.com/mgechev/golinter
|
package: github.com/mgechev/revive
|
||||||
import:
|
import:
|
||||||
- package: github.com/ttacon/chalk
|
- package: github.com/ttacon/chalk
|
||||||
version: ~0.1.0
|
version: ~0.1.0
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package linter
|
|||||||
import (
|
import (
|
||||||
"go/token"
|
"go/token"
|
||||||
|
|
||||||
"github.com/mgechev/golinter/file"
|
"github.com/mgechev/revive/file"
|
||||||
"github.com/mgechev/golinter/rules"
|
"github.com/mgechev/revive/rules"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ReadFile defines an abstraction for reading files.
|
// ReadFile defines an abstraction for reading files.
|
||||||
|
|||||||
8
main.go
8
main.go
@@ -3,10 +3,10 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/mgechev/golinter/defaultrules"
|
"github.com/mgechev/revive/defaultrules"
|
||||||
"github.com/mgechev/golinter/formatters"
|
"github.com/mgechev/revive/formatters"
|
||||||
"github.com/mgechev/golinter/linter"
|
"github.com/mgechev/revive/linter"
|
||||||
"github.com/mgechev/golinter/rules"
|
"github.com/mgechev/revive/rules"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package rules
|
|||||||
import (
|
import (
|
||||||
"go/token"
|
"go/token"
|
||||||
|
|
||||||
"github.com/mgechev/golinter/file"
|
"github.com/mgechev/revive/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package visitors
|
|||||||
import (
|
import (
|
||||||
"go/token"
|
"go/token"
|
||||||
|
|
||||||
"github.com/mgechev/golinter/file"
|
"github.com/mgechev/revive/file"
|
||||||
"github.com/mgechev/golinter/rules"
|
"github.com/mgechev/revive/rules"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RuleVisitor defines a struct for a visitor.
|
// RuleVisitor defines a struct for a visitor.
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/mgechev/golinter/file"
|
"github.com/mgechev/revive/file"
|
||||||
"github.com/mgechev/golinter/rules"
|
"github.com/mgechev/revive/rules"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Setup sets the proper pointers of given visitor.
|
// Setup sets the proper pointers of given visitor.
|
||||||
|
|||||||
Reference in New Issue
Block a user