mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
Fix: format & lint (#1759)
* Fix: gci command for formatting code * Chore: format code * Fix: replace golint with revive
This commit is contained in:
@@ -2,14 +2,12 @@ run:
|
||||
timeout: 5m
|
||||
skip-files:
|
||||
- generated.*
|
||||
|
||||
issues:
|
||||
new: true
|
||||
exclude-rules:
|
||||
- linters:
|
||||
- staticcheck
|
||||
- staticcheck
|
||||
text: "SA1019:"
|
||||
|
||||
linters:
|
||||
enable:
|
||||
- asciicheck
|
||||
@@ -19,13 +17,13 @@ linters:
|
||||
- gofmt
|
||||
- gofumpt
|
||||
- goimports
|
||||
- golint
|
||||
- goprintffuncname
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- misspell
|
||||
- nakedret
|
||||
- revive
|
||||
- rowserrcheck
|
||||
- staticcheck
|
||||
- structcheck
|
||||
@@ -39,7 +37,11 @@ linters:
|
||||
- deadcode
|
||||
- errcheck
|
||||
- unused
|
||||
|
||||
linters-settings:
|
||||
goimports:
|
||||
local-prefixes: github.com/v2fly/v2ray-core
|
||||
revive:
|
||||
rules:
|
||||
- name: blank-imports
|
||||
severity: warning
|
||||
disabled: true
|
||||
|
||||
@@ -170,8 +170,12 @@ func main() {
|
||||
}
|
||||
|
||||
goimportsArgs := []string{
|
||||
"-w",
|
||||
"-local", "github.com/v2fly/v2ray-core",
|
||||
"write",
|
||||
"--NoInlineComments",
|
||||
"--NoPrefixComments",
|
||||
"--Section", "Standard",
|
||||
"--Section", "Default",
|
||||
"--Section", "pkgPrefix(github.com/v2fly/v2ray-core)",
|
||||
}
|
||||
|
||||
RunMany(gofmt, gofmtArgs, rawFilesSlice)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package encoding_test
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/buf"
|
||||
|
||||
@@ -3,8 +3,6 @@ package http
|
||||
import (
|
||||
"bufio"
|
||||
"net/http"
|
||||
|
||||
// required to use go:linkname
|
||||
_ "unsafe"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user