chore(lint): satisfy golangci for resize follow-ups
- commit
- 4128564e006d66b4eb3980ef31d15c719c93fff2
- author
- brice · · 2026-05-21 07:03 UTC
- parent
- 5fef01b
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
3 files · +19 -6
M internal/infrastructure/cef/webview_viewport.go +8 -2
| @@ -291,7 +291,10 @@ func (wv *WebView) shouldDeferPendingBrowserCreateFromViewportSync() bool { | |||
| 291 | 291 | return wv != nil && wv.awaitsNativePopupAttachment() | |
| 292 | 292 | } | |
| 293 | 293 | ||
| 294 | - | func pendingBrowserCreateObservedSize(bridge pendingBrowserCreateObservedSizeBridge, allocatedWidth, allocatedHeight int32) (observedWidth, observedHeight int32, ready bool) { | |
| 294 | + | func pendingBrowserCreateObservedSize( | |
| 295 | + | bridge pendingBrowserCreateObservedSizeBridge, | |
| 296 | + | allocatedWidth, allocatedHeight int32, | |
| 297 | + | ) (observedWidth, observedHeight int32, ready bool) { | |
| 295 | 298 | if bridge == nil { | |
| 296 | 299 | return 0, 0, false | |
| 297 | 300 | } | |
| @@ -332,7 +335,10 @@ func abs32(v int32) int32 { | |||
| 332 | 335 | // It returns the current attempt count and the resulting action. Scheduling is | |
| 333 | 336 | // coalesced so only one delayed retry is pending at a time, while the max-retry | |
| 334 | 337 | // path proceeds without leaving the scheduled flag set. | |
| 335 | - | func (wv *WebView) preparePendingBrowserCreateObservedSizeRetry(ctx context.Context, reason string) (attempt int, action pendingBrowserCreateObservedSizeRetryAction) { | |
| 338 | + | func (wv *WebView) preparePendingBrowserCreateObservedSizeRetry( | |
| 339 | + | ctx context.Context, | |
| 340 | + | reason string, | |
| 341 | + | ) (attempt int, action pendingBrowserCreateObservedSizeRetryAction) { | |
| 336 | 342 | if wv == nil { | |
| 337 | 343 | return 0, pendingBrowserCreateObservedSizeRetryUnavailable | |
| 338 | 344 | } | |
| @@ -291,7 +291,10 @@ func (wv *WebView) shouldDeferPendingBrowserCreateFromViewportSync() bool { | |||||
| 291 | return wv != nil && wv.awaitsNativePopupAttachment() | 291 | return wv != nil && wv.awaitsNativePopupAttachment() | ||
| 292 | } | 292 | } | ||
| 293 | 293 | ||||
| 294 | - | func pendingBrowserCreateObservedSize(bridge pendingBrowserCreateObservedSizeBridge, allocatedWidth, allocatedHeight int32) (observedWidth, observedHeight int32, ready bool) { | 294 | + | func pendingBrowserCreateObservedSize( |
| 295 | + | bridge pendingBrowserCreateObservedSizeBridge, | |||
| 296 | + | allocatedWidth, allocatedHeight int32, | |||
| 297 | + | ) (observedWidth, observedHeight int32, ready bool) { | |||
| 295 | if bridge == nil { | 298 | if bridge == nil { | ||
| 296 | return 0, 0, false | 299 | return 0, 0, false | ||
| 297 | } | 300 | } | ||
| @@ -332,7 +335,10 @@ func abs32(v int32) int32 { | |||||
| 332 | // It returns the current attempt count and the resulting action. Scheduling is | 335 | // It returns the current attempt count and the resulting action. Scheduling is | ||
| 333 | // coalesced so only one delayed retry is pending at a time, while the max-retry | 336 | // coalesced so only one delayed retry is pending at a time, while the max-retry | ||
| 334 | // path proceeds without leaving the scheduled flag set. | 337 | // path proceeds without leaving the scheduled flag set. | ||
| 335 | - | func (wv *WebView) preparePendingBrowserCreateObservedSizeRetry(ctx context.Context, reason string) (attempt int, action pendingBrowserCreateObservedSizeRetryAction) { | 338 | + | func (wv *WebView) preparePendingBrowserCreateObservedSizeRetry( |
| 339 | + | ctx context.Context, | |||
| 340 | + | reason string, | |||
| 341 | + | ) (attempt int, action pendingBrowserCreateObservedSizeRetryAction) { | |||
| 336 | if wv == nil { | 342 | if wv == nil { | ||
| 337 | return 0, pendingBrowserCreateObservedSizeRetryUnavailable | 343 | return 0, pendingBrowserCreateObservedSizeRetryUnavailable | ||
| 338 | } | 344 | } | ||
M internal/infrastructure/config/loader.go +5 -1
| @@ -159,7 +159,11 @@ func (m *Manager) transformLegacyConfig() { | |||
| 159 | 159 | rawConfig := m.viper.AllSettings() | |
| 160 | 160 | transformer := NewLegacyConfigTransformer() | |
| 161 | 161 | transformer.TransformLegacyActions(rawConfig) | |
| 162 | - | transformer.TransformLegacyEngineConfigWithExplicitAdaptive(rawConfig, m.hasExplicitAdaptiveWindowlessFrameRateSetting(), m.viper.GetBool("engine.cef.adaptive_windowless_frame_rate")) | |
| 162 | + | transformer.TransformLegacyEngineConfigWithExplicitAdaptive( | |
| 163 | + | rawConfig, | |
| 164 | + | m.hasExplicitAdaptiveWindowlessFrameRateSetting(), | |
| 165 | + | m.viper.GetBool("engine.cef.adaptive_windowless_frame_rate"), | |
| 166 | + | ) | |
| 163 | 167 | ||
| 164 | 168 | // AllSettings includes defaults, so workspace.browsing_contexts may already be | |
| 165 | 169 | // present even when the user only configured legacy workspace.popups. Always | |
| @@ -159,7 +159,11 @@ func (m *Manager) transformLegacyConfig() { | |||||
| 159 | rawConfig := m.viper.AllSettings() | 159 | rawConfig := m.viper.AllSettings() | ||
| 160 | transformer := NewLegacyConfigTransformer() | 160 | transformer := NewLegacyConfigTransformer() | ||
| 161 | transformer.TransformLegacyActions(rawConfig) | 161 | transformer.TransformLegacyActions(rawConfig) | ||
| 162 | - | transformer.TransformLegacyEngineConfigWithExplicitAdaptive(rawConfig, m.hasExplicitAdaptiveWindowlessFrameRateSetting(), m.viper.GetBool("engine.cef.adaptive_windowless_frame_rate")) | 162 | + | transformer.TransformLegacyEngineConfigWithExplicitAdaptive( |
| 163 | + | rawConfig, | |||
| 164 | + | m.hasExplicitAdaptiveWindowlessFrameRateSetting(), | |||
| 165 | + | m.viper.GetBool("engine.cef.adaptive_windowless_frame_rate"), | |||
| 166 | + | ) | |||
| 163 | 167 | ||||
| 164 | // AllSettings includes defaults, so workspace.browsing_contexts may already be | 168 | // AllSettings includes defaults, so workspace.browsing_contexts may already be | ||
| 165 | // present even when the user only configured legacy workspace.popups. Always | 169 | // present even when the user only configured legacy workspace.popups. Always | ||
M internal/infrastructure/config/transform_legacy.go +6 -3
| @@ -49,7 +49,10 @@ func (t *LegacyConfigTransformer) TransformLegacyEngineConfig(rawConfig map[stri | |||
| 49 | 49 | t.transformLegacyEngineConfig(rawConfig, hasAdaptive, adaptiveEnabled) | |
| 50 | 50 | } | |
| 51 | 51 | ||
| 52 | - | func (t *LegacyConfigTransformer) TransformLegacyEngineConfigWithExplicitAdaptive(rawConfig map[string]any, hasAdaptive bool, adaptiveEnabled bool) { | |
| 52 | + | func (t *LegacyConfigTransformer) TransformLegacyEngineConfigWithExplicitAdaptive( | |
| 53 | + | rawConfig map[string]any, | |
| 54 | + | hasAdaptive, adaptiveEnabled bool, | |
| 55 | + | ) { | |
| 53 | 56 | t.transformLegacyEngineConfig(rawConfig, hasAdaptive, adaptiveEnabled) | |
| 54 | 57 | } | |
| 55 | 58 | ||
| @@ -91,8 +94,8 @@ func nestedConfigBoolValue(rawConfig map[string]any, path ...string) (bool, bool | |||
| 91 | 94 | return false, false | |
| 92 | 95 | } | |
| 93 | 96 | if i == len(path)-1 { | |
| 94 | - | parsed, ok := value.(bool) | |
| 95 | - | return parsed, ok | |
| 97 | + | parsed, parsedOK := value.(bool) | |
| 98 | + | return parsed, parsedOK | |
| 96 | 99 | } | |
| 97 | 100 | next, ok := value.(map[string]any) | |
| 98 | 101 | if !ok { | |
| @@ -49,7 +49,10 @@ func (t *LegacyConfigTransformer) TransformLegacyEngineConfig(rawConfig map[stri | |||||
| 49 | t.transformLegacyEngineConfig(rawConfig, hasAdaptive, adaptiveEnabled) | 49 | t.transformLegacyEngineConfig(rawConfig, hasAdaptive, adaptiveEnabled) | ||
| 50 | } | 50 | } | ||
| 51 | 51 | ||||
| 52 | - | func (t *LegacyConfigTransformer) TransformLegacyEngineConfigWithExplicitAdaptive(rawConfig map[string]any, hasAdaptive bool, adaptiveEnabled bool) { | 52 | + | func (t *LegacyConfigTransformer) TransformLegacyEngineConfigWithExplicitAdaptive( |
| 53 | + | rawConfig map[string]any, | |||
| 54 | + | hasAdaptive, adaptiveEnabled bool, | |||
| 55 | + | ) { | |||
| 53 | t.transformLegacyEngineConfig(rawConfig, hasAdaptive, adaptiveEnabled) | 56 | t.transformLegacyEngineConfig(rawConfig, hasAdaptive, adaptiveEnabled) | ||
| 54 | } | 57 | } | ||
| 55 | 58 | ||||
| @@ -91,8 +94,8 @@ func nestedConfigBoolValue(rawConfig map[string]any, path ...string) (bool, bool | |||||
| 91 | return false, false | 94 | return false, false | ||
| 92 | } | 95 | } | ||
| 93 | if i == len(path)-1 { | 96 | if i == len(path)-1 { | ||
| 94 | - | parsed, ok := value.(bool) | 97 | + | parsed, parsedOK := value.(bool) |
| 95 | - | return parsed, ok | 98 | + | return parsed, parsedOK |
| 96 | } | 99 | } | ||
| 97 | next, ok := value.(map[string]any) | 100 | next, ok := value.(map[string]any) | ||
| 98 | if !ok { | 101 | if !ok { | ||