Skip to content

fix: satisfy the linter (funlen, gocognit, nolintlint, usetesting) - #1

Merged
malpou merged 1 commit into
mainfrom
fix/lint
Aug 1, 2026
Merged

fix: satisfy the linter (funlen, gocognit, nolintlint, usetesting)#1
malpou merged 1 commit into
mainfrom
fix/lint

Conversation

@malpou

@malpou malpou commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

The initial-release CI run failed on five golangci-lint issues introduced by the config work. This fixes all of them, verified against the exact version CI pins (v2.9.0 → 0 issues).

  • run() exceeded funlen → extracted flag parsing + config resolution into parseFlags.
  • TestResolutionOrder cognitive complexity → factored out a loadFromPath helper.
  • unused //nolint:gosec → removed.
  • os.Chdir in the test helper → t.Chdir (auto-restores).

go build, go test ./..., and golangci-lint run (v2.9.0) all green.

CI's golangci-lint flagged five issues after the config work:

- run() exceeded funlen (55 > 50): extract flag parsing and config
  resolution into parseFlags, returning an opts struct.
- TestResolutionOrder cognitive complexity 23 > 20: factor the repeated
  load-and-assert-path into a loadFromPath helper.
- unused //nolint:gosec directive: the linter no longer flags that read.
- os.Chdir in the test helper: use t.Chdir, which also restores the
  previous directory automatically.

Verified against golangci-lint v2.9.0 (the version CI pins): 0 issues.
@malpou
malpou merged commit 051c723 into main Aug 1, 2026
1 check passed
@metsarelease metsarelease Bot mentioned this pull request Aug 1, 2026
malpou pushed a commit that referenced this pull request Aug 1, 2026
🤖 I have created a release *beep* *boop*
---


## [0.1.2](v0.1.1...v0.1.2)
(2026-08-01)


### Bug Fixes

* satisfy the linter (funlen, gocognit, nolintlint, usetesting)
([#1](#1))
([051c723](051c723))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: metsarelease[bot] <261965670+metsarelease[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant