Skip to content

chore(deps): update module dev.gaijin.team/go/exhaustruct/v4 to v5#1879

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/dev.gaijin.team-go-exhaustruct-v4-5.x
Open

chore(deps): update module dev.gaijin.team/go/exhaustruct/v4 to v5#1879
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/dev.gaijin.team-go-exhaustruct-v4-5.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented May 18, 2026

This PR contains the following updates:

Package Change Age Confidence
dev.gaijin.team/go/exhaustruct/v4 v4.0.0v5.0.1 age confidence

Release Notes

GaijinEntertainment/go-exhaustruct (dev.gaijin.team/go/exhaustruct/v4)

v5.0.1

Compare Source

Two v5 API bugs traced to the same root cause: NewAnalyzer captured patterns into the processor before the analysis driver parsed flags, so flag-driven values never reached analysis, and the Config fields had to be typed against internal/pattern to be writable at all.

Fixes
  • -enforce-rx, -ignore-rx, -optional-rx, and -allow-empty-rx had no effect under the standalone CLI (#​155). Processor construction now happens lazily on first analyzer run, after flags are populated. golangci-lint integrations were unaffected, since they populate Config programmatically before calling NewAnalyzer.

  • analyzer.Config no longer leaks the internal pattern.List type (#​158). The four pattern fields (EnforcePatterns, IgnorePatterns, OptionalPatterns, AllowEmptyPatterns) are now plain []string; pattern compilation has moved inside the analyzer. Library callers populating these fields directly drop the pattern.NewList call:

    // before
    list, _ := pattern.NewList(`.*\.Foo`)
    analyzer.Config{ EnforcePatterns: list }
    
    // after
    analyzer.Config{ EnforcePatterns: []string{`.*\.Foo`} }
Upgrading
go install dev.gaijin.team/go/exhaustruct/v5/cmd/exhaustruct@latest

CLI users reinstall. Library callers update Config field assignments as shown above.

v5.0.0

Compare Source

exhaustruct v5 reshapes how the linter is configured. Struct tags give way to comment directives, opt-in checking lands as a first-class mode, and patterns now reach down to individual fields. The full reference is in the README; this is the highlight reel.

What's new

Comment directives replace struct tags. Three directives — enforce, ignore, optional — now work at three levels of granularity: type definitions, struct literals, and individual fields. A documented priority order keeps the interaction between them predictable.

//exhaustruct:enforce
type Config struct {
    Host    string
    //exhaustruct:optional
    Timeout int
}

Explicit mode (-explicit) flips the default. Instead of checking every struct literal in the project, the linter only checks types you've explicitly marked — either with //exhaustruct:enforce or via -enforce-rx. The right pick for large codebases where exhaustruct should be a precision tool, not a blanket policy.

Field-level regex patterns. The pattern flags now accept Type#Field syntax, so a single configuration line can express optionality across a codebase without touching the type definitions:

.*\.Server#Timeout    # Timeout field in any Server type

Optional patterns (-optional-rx). Regex-based optionality for whole types or specific fields. Closes a long-standing gap for third-party types you can't annotate directly.

Derived types and aliases now follow a clearer rule. Field-level directives carry through type T = U and type T U — so a field marked optional stays optional on every alias and derived type. Type-level directives stay attached to the original type, which means you can promote a derived type to "enforced" independently.

Better diagnostics. -report-full-type-path reports net/http.Cookie instead of http.Cookie, removing ambiguity when import aliases are in play (#​146). -debug-cache-metrics prints per-package cache statistics, useful for tuning patterns on large projects.

Auto-migration. exhaustruct -fix ./... rewrites the legacy exhaustruct:"optional" tags to comment directives in one pass — no manual sweep required.

Breaking changes
  • Struct tags retired. exhaustruct:"optional" is no longer recognized. The -fix flag migrates existing tags automatically; the manual equivalent is a one-line move from the field's struct tag to a //exhaustruct:optional comment above (or beside) the field.
  • Flag rename. The old include/exclude vocabulary suggested filtering, but the linter has always been about enforcement. The new names say what they do:
    • -include-rx / -i-enforce-rx
    • -exclude-rx / -e-ignore-rx
  • Module path moves to /v5. Update imports and reinstall:
    go install dev.gaijin.team/go/exhaustruct/v5/cmd/exhaustruct@latest
Fixes
  • Implicit pointer composite literals (&T{} returned where the function signature expects *T) are now flagged — previously they slipped past the checker (#​147).
  • Aliased struct types resolve through types.Unalias so their fields are inspected even behind an alias chain (#​149).
Migrating from v4
  1. Update import paths from /v4 to /v5.
  2. Run exhaustruct -fix ./... to rewrite struct tags to comment directives.
  3. Replace -include-rx / -i with -enforce-rx, and -exclude-rx / -e with -ignore-rx in CI configs and .golangci.yaml.
  4. Optional: consider -explicit if you'd rather opt specific types into checking than opt the rest out.

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the dependencies Pull requests that update a dependency file label May 18, 2026
@renovate renovate Bot requested a review from a team as a code owner May 18, 2026 21:03
@renovate renovate Bot added the Skip Changelog PRs that do not require a CHANGELOG.md entry label May 18, 2026
@renovate renovate Bot requested review from a team as code owners May 18, 2026 21:03
@renovate renovate Bot added dependencies Pull requests that update a dependency file Skip Changelog PRs that do not require a CHANGELOG.md entry labels May 18, 2026
@renovate renovate Bot requested a review from mx-psi May 18, 2026 21:03
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.59%. Comparing base (fecc61e) to head (9563269).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1879   +/-   ##
=======================================
  Coverage   71.59%   71.59%           
=======================================
  Files           2        2           
  Lines          88       88           
=======================================
  Hits           63       63           
  Misses         13       13           
  Partials       12       12           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@renovate renovate Bot force-pushed the renovate/dev.gaijin.team-go-exhaustruct-v4-5.x branch 18 times, most recently from 115b3bb to 269abca Compare May 26, 2026 09:37
@renovate renovate Bot force-pushed the renovate/dev.gaijin.team-go-exhaustruct-v4-5.x branch 3 times, most recently from 0724d12 to 1753169 Compare May 28, 2026 09:45
@renovate renovate Bot force-pushed the renovate/dev.gaijin.team-go-exhaustruct-v4-5.x branch from 1753169 to 9563269 Compare May 28, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants