From 03e4b5d525940ca3aaa33384767c1438711dae00 Mon Sep 17 00:00:00 2001 From: Dreamacro <8615343+Dreamacro@users.noreply.github.com> Date: Sat, 19 Feb 2022 00:08:51 +0800 Subject: [PATCH] Chore: use golangci-lint config file --- .golangci.yaml | 14 ++++++++++++++ Makefile | 2 +- component/dialer/bind_darwin.go | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 .golangci.yaml diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..efe9152 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,14 @@ +linters: + disable-all: true + enable: + - gofumpt + - megacheck + - govet + - gci + +linters-settings: + gci: + sections: + - standard + - prefix(github.com/Dreamacro/clash) + - default diff --git a/Makefile b/Makefile index b6a5b22..c9c5113 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,7 @@ all-arch: $(PLATFORM_LIST) $(WINDOWS_ARCH_LIST) releases: $(gz_releases) $(zip_releases) lint: - golangci-lint run --disable-all -E govet -E gofumpt -E megacheck ./... + golangci-lint run ./... clean: rm $(BINDIR)/* diff --git a/component/dialer/bind_darwin.go b/component/dialer/bind_darwin.go index bf51b30..57e09bb 100644 --- a/component/dialer/bind_darwin.go +++ b/component/dialer/bind_darwin.go @@ -4,9 +4,9 @@ import ( "net" "syscall" - "golang.org/x/sys/unix" - "github.com/Dreamacro/clash/component/iface" + + "golang.org/x/sys/unix" ) type controlFn = func(network, address string, c syscall.RawConn) error