From 437f1f819c9c5eb9fe3611d20b47ee864ff2f13a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 9 Feb 2023 21:01:48 +0800 Subject: [PATCH] Fix lint --- .golangci.yml | 15 ++++++++------- Makefile | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 11442290..d30fa30d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,7 +3,7 @@ linters: enable: - gofumpt - govet -# - gci + - gci - staticcheck - paralleltest @@ -14,10 +14,11 @@ run: - transport/cloudflaretls linters-settings: -# gci: -# sections: -# - standard -# - prefix(github.com/sagernet/) -# - default + gci: + custom-order: true + sections: + - standard + - prefix(github.com/sagernet/) + - default staticcheck: - go: '1.19' + go: '1.20' diff --git a/Makefile b/Makefile index 01d63781..19a53276 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,11 @@ install: fmt: @gofumpt -l -w . @gofmt -s -w . - @gci write -s "standard,prefix(github.com/sagernet/),default" . + @gci write --custom-order -s "standard,prefix(github.com/sagernet/),default" . fmt_install: go install -v mvdan.cc/gofumpt@latest - go install -v github.com/daixiang0/gci@v0.4.0 + go install -v github.com/daixiang0/gci@latest lint: GOOS=linux golangci-lint run ./...