Skip to content

Commit

Permalink
chore: update linter config
Browse files Browse the repository at this point in the history
Signed-off-by: Jian Zeng <[email protected]>
  • Loading branch information
knight42 committed Jan 6, 2024
1 parent b76d4a7 commit e4127f4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ linters:
enable:
- exhaustive
- exportloopref
- gci
- gochecknoinits
- goconst
- gocritic
Expand All @@ -52,6 +53,11 @@ linters:
- whitespace

linters-settings:
gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/ustclug/Yuki)
exhaustive:
# Only run exhaustive check on switches with "//exhaustive:enforce" comment.
explicit-exhaustive-switch: true
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: lint
lint:
golangci-lint run ./...
golangci-lint run --fix ./...

.PHONY: unit-test
unit-test:
Expand All @@ -18,12 +18,14 @@ yukid:
yukictl:
go build -trimpath ./cmd/yukictl

BUILD_IMAGE ?= golang:1.21-bookworm

.PHONY: yukid-linux
yukid-linux:
@docker run \
--rm \
--mount source=go-cache,destination=/root/.cache/go-build \
--mount source=go-mod,destination=/go/pkg/mod \
-v $(PWD):/app \
golang:1.21-bookworm \
$(BUILD_IMAGE) \
bash -c 'cd /app && make yukid'
3 changes: 1 addition & 2 deletions test/integration/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import (
"github.com/go-resty/resty/v2"
"github.com/stretchr/testify/require"

testutils "github.com/ustclug/Yuki/test/utils"

"github.com/ustclug/Yuki/pkg/api"
"github.com/ustclug/Yuki/pkg/server"
testutils "github.com/ustclug/Yuki/test/utils"
)

func TestSyncRepo(t *testing.T) {
Expand Down

0 comments on commit e4127f4

Please sign in to comment.