chore(deps): update module dev.gaijin.team/go/exhaustruct/v4 to v5#1879
Open
renovate[bot] wants to merge 1 commit into
Open
chore(deps): update module dev.gaijin.team/go/exhaustruct/v4 to v5#1879renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
115b3bb to
269abca
Compare
0724d12 to
1753169
Compare
1753169 to
9563269
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v4.0.0→v5.0.1Release Notes
GaijinEntertainment/go-exhaustruct (dev.gaijin.team/go/exhaustruct/v4)
v5.0.1Compare Source
Two v5 API bugs traced to the same root cause:
NewAnalyzercaptured patterns into the processor before the analysis driver parsed flags, so flag-driven values never reached analysis, and theConfigfields had to be typed againstinternal/patternto be writable at all.Fixes
-enforce-rx,-ignore-rx,-optional-rx, and-allow-empty-rxhad 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 populateConfigprogrammatically before callingNewAnalyzer.analyzer.Configno longer leaks the internalpattern.Listtype (#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 thepattern.NewListcall:Upgrading
CLI users reinstall. Library callers update
Configfield assignments as shown above.v5.0.0Compare Source
exhaustructv5 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.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:enforceor 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#Fieldsyntax, so a single configuration line can express optionality across a codebase without touching the type definitions: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 = Uandtype 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-pathreportsnet/http.Cookieinstead ofhttp.Cookie, removing ambiguity when import aliases are in play (#146).-debug-cache-metricsprints per-package cache statistics, useful for tuning patterns on large projects.Auto-migration.
exhaustruct -fix ./...rewrites the legacyexhaustruct:"optional"tags to comment directives in one pass — no manual sweep required.Breaking changes
exhaustruct:"optional"is no longer recognized. The-fixflag migrates existing tags automatically; the manual equivalent is a one-line move from the field's struct tag to a//exhaustruct:optionalcomment above (or beside) the field.include/excludevocabulary 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/v5. Update imports and reinstall:Fixes
&T{}returned where the function signature expects*T) are now flagged — previously they slipped past the checker (#147).types.Unaliasso their fields are inspected even behind an alias chain (#149).Migrating from v4
/v4to/v5.exhaustruct -fix ./...to rewrite struct tags to comment directives.-include-rx/-iwith-enforce-rx, and-exclude-rx/-ewith-ignore-rxin CI configs and.golangci.yaml.-explicitif you'd rather opt specific types into checking than opt the rest out.Configuration
📅 Schedule: (UTC)
🚦 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.
This PR was generated by Mend Renovate. View the repository job log.