Skip to content

Commit 77b0a29

Browse files
committed
Go imports tooling
Signed-off-by: apostasie <[email protected]>
1 parent 0b729e9 commit 77b0a29

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ jobs:
3434
run: make lint-yaml
3535
- name: shellcheck
3636
run: make lint-shell
37+
- name: go imports ordering
38+
run: |
39+
go install -v github.com/incu6us/goimports-reviser/v3@latest
40+
make lint-imports
3741
3842
test-unit:
3943
runs-on: ubuntu-24.04

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ clean:
7070
lint: lint-go lint-yaml lint-shell
7171

7272
lint-go:
73-
cd $(MAKEFILE_DIR) && golangci-lint run $(VERBOSE_FLAG_LONG)
73+
cd $(MAKEFILE_DIR) && golangci-lint run $(VERBOSE_FLAG_LONG) ./...
74+
75+
lint-imports:
76+
cd $(MAKEFILE_DIR) && goimports-reviser -list-diff -company-prefixes "github.com/containerd" ./...
77+
78+
lint-fix-imports:
79+
cd $(MAKEFILE_DIR) && goimports-reviser -company-prefixes "github.com/containerd" ./...
7480

7581
lint-yaml:
7682
cd $(MAKEFILE_DIR) && yamllint .

0 commit comments

Comments
 (0)