Skip to content

chore(lint): enforce Go import grouping and named imports with gci and importas - #117

Merged
edenreich merged 1 commit into
mainfrom
fix/issue-116
Sep 16, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/issue-116

Conversation

@edenreich

Copy link
Copy Markdown
Contributor

Summary

  • Add .golangci.yml (v2) enabling the gci formatter with custom-order: true and the sections standard, github.com/stretchr/testify, default, github.com/inference-gateway/, github.com/inference-gateway/a2a-debugger.
  • Enable the importas linter with no-unaliased: true and a single catch-all rule that derives the alias from the last path element, so every non-standard-library import must be named (cobra "github.com/spf13/cobra"). No per-package pins were needed.
  • Reformat the existing Go files once with golangci-lint fmt and golangci-lint run --fix. The adk alias for github.com/inference-gateway/adk/types becomes types.
  • Document the convention and the local fix commands in AGENTS.md and CLAUDE.md.

CI already runs task lint (golangci-lint run), so the check is enforced on every PR as soon as this lands.

Same concept as inference-gateway/inference-gateway#667, inference-gateway/sdk#182, inference-gateway/operator#223, inference-gateway/adk#307 and inference-gateway/adl-cli#417.

Test plan

  • golangci-lint run ./... (v2.12.2, the version CI pins) reports 0 issues
  • gofmt -l . with the repo Go toolchain reports nothing
  • go build ./... && go vet ./... && go test ./... pass

Closes #116

…d importas

Add .golangci.yml enabling the gci formatter with a fixed section order
(standard, testify, third-party, github.com/inference-gateway/*, this
module) and the importas linter with no-unaliased so every non-standard
import is named after its last path element. Reformat the existing files
once and document the convention in AGENTS.md and CLAUDE.md.

Closes #116
@edenreich
edenreich merged commit ca24b08 into main Sep 16, 2026
2 checks passed
@edenreich
edenreich deleted the fix/issue-116 branch September 16, 2026 15:21
inference-gateway-releaser Bot added a commit that referenced this pull request Oct 3, 2026
## [0.11.0](v0.10.0...v0.11.0) (2026-10-03)

### ✨ Features

* **auth:** add auth command and credential flags ([#114](#114)) ([b40e02a](b40e02a))

### ♻️ Improvements

* adopt A2A v1.0.1 method names via adk v0.31.0 ([#133](#133)) ([18f5323](18f5323))

### 👷 CI

* **claude:** centralize claude.yml via reusable workflow ([#123](#123)) ([c64f10f](c64f10f))
* **claude:** centralize claude.yml via reusable workflow ([#126](#126)) ([d2c0b71](d2c0b71))

### 📚 Documentation

* **agents:** refresh AGENTS.md for current code layout ([#118](#118)) ([efee952](efee952))

### 🔧 Miscellaneous

* **deps:** bump claude-code 2.1.245 -> 2.1.266 ([#112](#112)) ([2c185f0](2c185f0))
* **deps:** bump claude-code 2.1.266 -> 2.1.278 ([#121](#121)) ([8a66dea](8a66dea))
* **deps:** bump claude-code 2.1.278 -> 2.1.280 ([#124](#124)) ([de903b9](de903b9))
* **deps:** bump claude-code 2.1.280 -> 2.1.283 ([#127](#127)) ([9fc5ace](9fc5ace))
* **deps:** bump claude-code 2.1.283 -> 2.1.285 ([#131](#131)) ([b2b57c2](b2b57c2))
* **deps:** bump infer CLI v0.183.0 -> v0.192.0 ([#113](#113)) ([58338f7](58338f7))
* **deps:** bump infer CLI v0.192.0 -> v0.205.3 ([#122](#122)) ([dcc41b7](dcc41b7))
* **deps:** bump infer CLI v0.205.3 -> v0.208.0 ([#125](#125)) ([921b772](921b772))
* **deps:** bump infer CLI v0.208.0 -> v0.218.0 ([#128](#128)) ([b1dbfed](b1dbfed))
* **deps:** bump infer CLI v0.218.0 -> v0.221.1 ([#130](#130)) ([775c18c](775c18c))
* **lint:** enforce Go import grouping and named imports with gci and importas ([#117](#117)) ([ca24b08](ca24b08)), closes [#116](#116)

### 🔨 Miscellaneous

* **deps:** bump docker/setup-buildx-action in the github-actions group ([#120](#120)) ([2c42a52](2c42a52))
* **deps:** bump github.com/inference-gateway/adk in the gomod group ([#115](#115)) ([479f614](479f614))
* **deps:** bump github.com/inference-gateway/adk in the gomod group ([#119](#119)) ([e8bf20c](e8bf20c))
* **deps:** bump github.com/inference-gateway/adk in the gomod group ([#129](#129)) ([d1b7019](d1b7019))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Enforce Go import order with gci in golangci-lint

1 participant